Integrations / Google Ads
Google Ads
Read Google Ads accounts and campaign performance with GAQL reports, and pause or enable campaigns.
5 actions
OAuth 2
4 read1 write
Calls googleads.googleapis.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "googleads" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
https://www.googleapis.com/auth/userinfo.email | See which Google account you connected |
https://www.googleapis.com/auth/adwords | See and manage your Google Ads accounts and campaigns |
Actions
Get ad group performancereadgoogleads.get_ad_group_performanceReport impressions, clicks, cost and conversions for each ad group over a date range, highest spend first (up to 100). Cost is in micros: divide by 1,000,000 for the account currency.
Needs scope: https://www.googleapis.com/auth/adwords
| Input | Type | Description | |
|---|---|---|---|
date_range | string | Required | Date range keyword |
customer_id | string | Required | Google Ads customer ID, digits only without hyphens, for example 1234567890 |
login_customer_id | string | Optional | Manager (MCC) account ID, digits only. Required when the connected user reaches this customer through a manager account; leave out for direct access. |
await setu.execute({
userId: "user_1",
action: "googleads.get_ad_group_performance",
input: {
"customer_id": "<customer_id>",
"date_range": "<date_range>"
},
});Get campaign performancereadgoogleads.get_campaign_performanceReport impressions, clicks, cost and conversions for each campaign over a date range, highest spend first (up to 100). Cost is in micros: divide by 1,000,000 for the account currency.
Needs scope: https://www.googleapis.com/auth/adwords
| Input | Type | Description | |
|---|---|---|---|
date_range | string | Required | Date range keyword |
customer_id | string | Required | Google Ads customer ID, digits only without hyphens, for example 1234567890 |
login_customer_id | string | Optional | Manager (MCC) account ID, digits only. Required when the connected user reaches this customer through a manager account; leave out for direct access. |
await setu.execute({
userId: "user_1",
action: "googleads.get_campaign_performance",
input: {
"customer_id": "<customer_id>",
"date_range": "<date_range>"
},
});List accessible customersreadgoogleads.list_accessible_customersList the Google Ads customer accounts the connected Google user can access directly. Returns resource names like customers/1234567890; the digits are the customer ID.
Needs scope: https://www.googleapis.com/auth/adwords
No input.
await setu.execute({
userId: "user_1",
action: "googleads.list_accessible_customers",
input: {},
});Run GAQL queryreadgoogleads.searchRun a Google Ads Query Language (GAQL) SELECT query against a customer and return rows (up to 10,000 per page). Pass next_page_token back as page_token to continue.
Needs scope: https://www.googleapis.com/auth/adwords
| Input | Type | Description | |
|---|---|---|---|
customer_id | string | Required | Google Ads customer ID, digits only without hyphens, for example 1234567890 |
login_customer_id | string | Optional | Manager (MCC) account ID, digits only. Required when the connected user reaches this customer through a manager account; leave out for direct access. |
query | string | Required | GAQL query, for example SELECT campaign.id, campaign.name, metrics.clicks FROM campaign WHERE segments.date DURING LAST_7_DAYS |
page_token | string | Optional | next_page_token from the previous call |
await setu.execute({
userId: "user_1",
action: "googleads.search",
input: {
"customer_id": "<customer_id>",
"query": "<query>"
},
});Pause or enable campaignwritegoogleads.set_campaign_statusPause or enable one campaign. Enabling a campaign makes it start spending its budget again, so confirm with the user first.
Needs scope: https://www.googleapis.com/auth/adwords
| Input | Type | Description | |
|---|---|---|---|
customer_id | string | Required | Google Ads customer ID, digits only without hyphens, for example 1234567890 |
login_customer_id | string | Optional | Manager (MCC) account ID, digits only. Required when the connected user reaches this customer through a manager account; leave out for direct access. |
campaign_id | string | Required | Campaign ID (digits), from get_campaign_performance |
status | string | Required | New status |
await setu.execute({
userId: "user_1",
action: "googleads.set_campaign_status",
input: {
"customer_id": "<customer_id>",
"campaign_id": "<campaign_id>",
"status": "<status>"
},
});