Search code examples
pythongoogle-cloud-platformintegrationgoogle-ads-api

is there a direct explanation for each google-ads.yaml item?


I am looking for collect data from Google ADS API into GCP by using Python scripts and it requires to fill these items for authentication in the google-ads.yaml file:

developer_token:
client_id:
client_secret:
refresh_token:
login_customer_id:

I was able to fill these items by asking people in my company or generating it with google python scripts in GitHub but I need to understand the role of each, the docs seems to be disperse with a long learning path.


Solution

  • You can follow this guidebook to make your google-ads.yaml file. And for the sample role you provided, below are the definitions of each but you can check this sample template for more details about it.

    Developer token

    A developer token is required when making requests to the Google Ads API regardless of whether you're using the OAuth2 or Service Account configurations. To obtain a developer token see: https://developers.google.com/google-ads/api/docs/first-call/dev-token

    developer_token: INSERT_DEVELOPER_TOKEN_HERE

    OAuth2 configuration

    The below configuration parameters are used to authenticate using the recommended OAuth2 flow. For more information on authenticating with OAuth2 see: https://developers.google.com/google-ads/api/docs/oauth/overview

    client_id: INSERT_OAUTH2_CLIENT_ID_HERE

    client_secret: INSERT_OAUTH2_CLIENT_SECRET_HERE

    refresh_token: INSERT_REFRESH_TOKEN_HERE

    Login customer ID configuration

    Required for manager accounts only: Specify the login customer ID used to authenticate API calls. This will be the customer ID of the authenticated manager account. It should be set without dashes, for example: 1234567890 instead of 123-456-7890. You can also specify this later in code if your application uses multiple manager account + OAuth pairs.

    login_customer_id: INSERT_LOGIN_CUSTOMER_ID_HERE