Quick reference
| Property | Value |
|---|---|
| Platform value | googleads |
| One connected account | One Google Ads client account. |
| Supported | Connect 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 |
| Features | Ads ✓ |
| Provider approval | Google Cloud Ads API access level, OAuth verification and advertiser authorization; live verification pending |
| Manager accounts | Optional google_ads_manager_id / google_ads_customer_id when creating the connect link |
| Token | Access 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:
- In console.cloud.google.com create (or reuse) a project and a Web application OAuth client; copy its Client ID and Client secret.
- Enable the Google Ads API.
- Authorized redirect URI: https://YOUR_DOMAIN/auth/callback/googleads
- 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.
| Permission | Requested by default | Used for |
|---|---|---|
https://www.googleapis.com/auth/adwords | Yes | Google Ads API access (fixed; cannot be changed) |
Connect an account
/api/v1/projects/{project_id}/connect-sessionsconnections:writeCreate 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"
}
EOFAfter 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"
}
EOFEach selected client account is one connected (billed) account.
Read campaigns and reports
/api/v1/projects/{project_id}/ads/queryads:readcurl -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
}
EOFHelpers: /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
/api/v1/projects/{project_id}/ads/operationsads:writePause/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
| Error | Meaning | Fix |
|---|---|---|
account_reconnection_required | The refresh token is no longer valid. | Reconnect the account. |
ads_spend_disabled | The change affects spend. | Enable ADS_SPEND_ENABLED and use a key with ads:spend. |