GoogleAdsHook

Google

Hook for the Google Ads API.

View on GitHub

Last Updated: Apr. 8, 2023

Access Instructions

Install the Google provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

gcp_conn_idThe connection ID with the service account details.
google_ads_conn_idThe connection ID with the details of Google Ads config.yaml file.
api_versionThe Google Ads API version to use.

Documentation

Hook for the Google Ads API.

This hook requires two connections:

  • gcp_conn_id - provides service account details (like any other GCP connection)

  • google_ads_conn_id - which contains information from Google Ads config.yaml file in the extras. Example of the extras:

{
"google_ads_client": {
"developer_token": "{{ INSERT_TOKEN }}",
"json_key_file_path": null,
"impersonated_email": "{{ INSERT_IMPERSONATED_EMAIL }}"
}
}

The json_key_file_path is resolved by the hook using credentials from gcp_conn_id. https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-service

See also

For more information on how Google Ads authentication flow works take a look at: https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-service

See also

For more information on the Google Ads API, take a look at the API docs: https://developers.google.com/google-ads/api/docs/start

Was this page helpful?