Setu Recipes: reusable digital workers across every app.Browse templates

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

TypeScript
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

ScopeWhy it is requested
https://www.googleapis.com/auth/userinfo.emailSee which Google account you connected
https://www.googleapis.com/auth/adwordsSee 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

InputTypeDescription
date_rangestringRequiredDate range keyword
customer_idstringRequiredGoogle Ads customer ID, digits only without hyphens, for example 1234567890
login_customer_idstringOptionalManager (MCC) account ID, digits only. Required when the connected user reaches this customer through a manager account; leave out for direct access.
TypeScript
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

InputTypeDescription
date_rangestringRequiredDate range keyword
customer_idstringRequiredGoogle Ads customer ID, digits only without hyphens, for example 1234567890
login_customer_idstringOptionalManager (MCC) account ID, digits only. Required when the connected user reaches this customer through a manager account; leave out for direct access.
TypeScript
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.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "googleads.list_accessible_customers",
  input: {},
});
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

InputTypeDescription
customer_idstringRequiredGoogle Ads customer ID, digits only without hyphens, for example 1234567890
login_customer_idstringOptionalManager (MCC) account ID, digits only. Required when the connected user reaches this customer through a manager account; leave out for direct access.
campaign_idstringRequiredCampaign ID (digits), from get_campaign_performance
statusstringRequiredNew status
TypeScript
await setu.execute({
  userId: "user_1",
  action: "googleads.set_campaign_status",
  input: {
    "customer_id": "<customer_id>",
    "campaign_id": "<campaign_id>",
    "status": "<status>"
  },
});