Google Ads
The Google Ads connector provides automated ingestion of performance data from the Google Ads API.
Prerequisites
Google Ads requires authentication either through a Google Service Account or Google OAuth.
Google Service Account
To authenticate via a Google Service Account add a Key with the Credential Type Google Service Account
Service accounts differ from user accounts in several key ways.
- Client Email
- Email address associated with the Service Account
- Key Name
- Value set here will be used in your Switchboard Script.
- Key Type
- Corresponds to the format of the Service Account Key. Typically the value is
json
- Service Account Key
- Entire text of the key pair provided when a Service Account is generated
Google OAuth
To authenticate via Oauth you must add a Key with the Credential Type Google OAuth
, enter a Key Name (used in the Switchboard Script below) and perform the Oauth flow by clicking the button labeled Connect
.
Scheduling
The Google Ads Connector can be scheduled to ingest data once per day at a user-defined hour and timezone.
By default, the connector will run once at 6am PT.
See Daily Scheduling for more information.
Parameters
- client_customer_ids string list
- required
- A list of 10 digit Google Ads Accounts. A customer ID is unique number used to identify your Google Ads account Find your Google Ads customer ID
- manager_customer_id string
- optional
- 10 digit id of the “manager” Account, if available. This must be the customer ID of the manager account and the
client_customer_ids
must be the client ids under that manager account. This parameter is required only for those ad accounts that are setup with a manager account. - query string
- required
- A query formulated with the Google Ads Query Language to find resources and their related attributes, segments, and metrics using
Below is an example query for a given resource and related metrics.
SELECT
campaign.id,
campaign.name,
campaign.status,
metrics.impressions
FROM campaign
WHERE campaign.status = 'PAUSED'
AND metrics.impressions > 1000
ORDER BY campaign.id
Switchboard Script Syntax
download google_ads_ad_group_report_raw from {
type: "google_ads";
key: "ga_key";
client_customer_ids: [
"123-456-7890"
];
query: "
SELECT
segments.date,
segments.hour,
ad_group.name,
metrics.average_cost,
metrics.impressions
FROM
ad_group
WHERE segments.date DURING YESTERDAY
";
} using {
*
};
Special Notes
In order to execute backfills for this connector, you must include the variables {start_date}
and {end_date}
in the query
parameter of the Switchboard script.
The values for these variables will be set based on the calendar dates set when running a backfill.
download t from {
type: "google_ads";
key: ...
...
...
query: "SELECT
campaign.id, segments.date
FROM campaign
WHERE segments.date >= '{start_date}' AND segments.date < '{end_date}' ";
} using {*};