Authentication params - google-marketing-solutions/topic-mine GitHub Wiki
This section explains how to obtain the keys and tokens required to run Topic Mine that are then put in the config.json
file.
Parameters
Parameter | Required | Description |
---|---|---|
gemini_api_key | Yes | Required to use Gemini API. To obtain, follow instructions here. |
login_customer_id | No | Recommended to include. Required to use Google Ads' Keyword Planner. If not included, Topic Mine will use Gemini to generate keywords, which might not yield as precise keywords as the Keyword Planner. Google Ads customer ID, usually at the top right of Google Ads console with a format similar to XXX-XXX-XXXX. Copy without dashes or hyphens. |
google_ads_developer_token | No | Recommended to include. Required to use Google Ads' Keyword Planner. If not included, Topic Mine will use Gemini to generate keywords, which might not yield as precise keywords as the Keyword Planner. To obtain, follow instructions here. |
client_id and client_secret | No | Recommended to skip (not include in the config.json). Needed if you want to use project-level authentication, which is not recommended. To obtain, go to Google Cloud console -> APIs & Services -> Credentials -> + Create credentials -> OAuth Client ID -> Desktop app. |
refresh_token | No | Recommended to skip (not include in the config.json). Needed if you want to use project-level authentication, which is not recommended. To obtain, follow steps below. |
refresh_token steps:
-
Download credentials file generated in previous step
-
Rename it
creds.json
and paste insiderefresh_token_generator
folder -
Run
refresh_token_generator.py
:- Open a terminal
- Navigate using the
cd
command to the folder calledrefresh_token_generator
. If you start with the terminal in the root directory, you must execute the following command:
cd /refresh_token_generator
-
Check that you are in the right folder with the command
ls
. It should show just one file calledrefresh_token_generator.py
-
Run the following command:
./refresh_token_generator.py
-
Open url shown in terminal and follow steps
-
Once allowed permission, a site unreachable will appear in the web browser. Do not close it, copy the full url from the browser
-
Paste url in terminal and hit enter
-
Refresh token will be provided |