Skip to content
techrace/
TECHRACE DOCUMENTATION

Google Ads

Connect Google Ads accounts (directly or through a manager account), read campaigns and reports, and make guarded changes.

Quick reference

PropertyValue
Platform valuegoogleads
One connected accountOne Google Ads client account.
SupportedConnect direct advertisers or explicitly selected manager clients; read account, campaigns, ad groups, ads and daily account/campaign/ad-group/ad insights; guarded pause/enable and atomic paused Search campaign creation
FeaturesAds ✓
Provider approvalGoogle Cloud Ads API access level, OAuth verification and advertiser authorization; live verification pending
Manager accountsOptional google_ads_manager_id / google_ads_customer_id when creating the connect link
TokenAccess token plus refresh token (renewed automatically)

Before you start

The person connecting needs:

  • A Google account with access to the Google Ads account (or its manager account).

You (the platform owner) need:

  1. In console.cloud.google.com create (or reuse) a project and a Web application OAuth client; copy its Client ID and Client secret.
  2. Enable the Google Ads API.
  3. Authorized redirect URI: https://YOUR_DOMAIN/auth/callback/googleads
  4. On the OAuth consent screen, add your Google account as a test user while the app is unverified.

Permissions (scopes)

Techrace puts these permissions in the login link. The person approves them on the provider's own screen; only approved permissions are granted.

PermissionRequested by defaultUsed for
https://www.googleapis.com/auth/adwordsYesGoogle Ads API access (fixed; cannot be changed)

Connect an account

POST/api/v1/projects/{project_id}/connect-sessionsconnections:write

Create a connect link with provider "googleads" and send the person's browser to the returned url. return_url is the page in your app where they land afterwards (https, or http://localhost while testing).

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/connect-sessions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "provider": "googleads",
  "return_url": "https://your-app.com/integrations/done"
}
EOF

After approval the person lands on your return_url with ?connected=googleads&customer_id=…&connection_id=…, or ?error=access_denied|expired|failed&provider=googleads. Your webhook also receives account.connected. Keep the connection_id: every call below uses it.

Connect through a manager account

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/connect-sessions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "provider": "googleads",
  "return_url": "https://your-app.com/integrations/done",
  "google_ads_manager_id": "1234567890"
}
EOF

Each selected client account is one connected (billed) account.

Read campaigns and reports

POST/api/v1/projects/{project_id}/ads/queryads:read
curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/ads/query" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "connection_id": "$CONNECTION_ID",
  "resource": "campaigns",
  "limit": 25
}
EOF

Helpers: /ads/google-targets, /ads/google-search-terms, /ads/google-search-context, /ads/google-campaign-goals, /ads/google-campaign-devices, /ads/google-campaign-locations, /ads/google-account-goals (all ads:read).

Make changes

POST/api/v1/projects/{project_id}/ads/operationsads:write

Pause/enable, paused Search campaign creation, budgets and targeting. Spend changes also need ads:spend and ADS_SPEND_ENABLED.

Limitations

  • New campaigns are created paused.
  • Writes are paused by default on the server.

Common errors

ErrorMeaningFix
account_reconnection_requiredThe refresh token is no longer valid.Reconnect the account.
ads_spend_disabledThe change affects spend.Enable ADS_SPEND_ENABLED and use a key with ads:spend.