Skip to content
Browse documentation

Google Ads API connection

Connect a Google Ads account with OAuth to upload conversions every 15 minutes (with enhanced conversions), import campaign costs and push the account tracking template.

Last updated 5 min read

On this page

The Google Ads API connection lets TrackCrown talk to Google Ads directly:

  • Conversion uploads — approved conversions with a gclid, gbraid or wbraid are uploaded every 15 minutes (UploadClickConversions, partial failures allowed), optionally with enhanced conversions;
  • Cost import — campaign spend per day, for ROAS and net profit;
  • Template push — set the account-level tracking template from the panel.

It is on Integrations → Google Ads API (/app/integrations?tab=google-ads) and needs the Admin role. If you cannot use the API, offline conversion feeds do the conversion part without it; both can run side by side.

Platform setup (once per installation)#

The OAuth client and developer token are shared by every workspace. A platform admin enters them on Ad platform apps (/admin/integrations), card Google Ads API:

FieldNotes
OAuth client IDA Web application OAuth client in Google Cloud.
Client secretStored encrypted; only a hint is shown again. Leave empty to keep it.
Developer tokenFrom the Google Ads API Center of your manager account. Stored encrypted.
API versionOptional, default v21.

Register this redirect URI on the OAuth client:

URL
https://app.trackcrown.com/api/app/gads/oauth/callback

Until this is done, workspaces see Google Ads API is not set up on this installation.

Connect a Google Ads account#

  1. Open Integrations → Google Ads API and click Connect Google Ads.
  2. Sign in with a Google account that can access the Google Ads account and approve access (scope https://www.googleapis.com/auth/adwords, plus your e-mail address).
  3. Back in TrackCrown, under Google Ads account, click Load my accounts and pick the Customer ID — or type it as 123-456-7890.
  4. If access goes through a manager account, enter Manager (MCC) ID.
  5. Click Use this account.

The status card shows Google account, Connected, Last upload run and Cost sync. The refresh token is stored encrypted.

Upload settings#

Under Upload settings:

Switch / fieldEffect
Upload conversions every 15 minutesTurns uploads on.
Also upload pending conversionsUploads pending as well as approved conversions. Google cannot retract them later.
Enhanced conversions (SHA-256 e-mail / phone from the postback)Adds hashed e-mail and phone to gclid uploads.
Import campaign costs (ROAS and net profit)Imports spend per campaign and day (see below).
Conversion valueRevenue, Payout, Sale amount or No value.

Click Save settings.

Map conversion actions#

  1. In Google Ads, create conversion actions of type Import → clicks (Track conversions from clicks).
  2. Under Conversion actions click Load from Google Ads to list the enabled actions of the account.
  3. Add mapping for each offer event: Offer, Event, Conversion action (or paste the conversion action ID). Up to 50 mappings.
  4. Click Save mappings.

Only mapped offer + event combinations are uploaded.

What is uploaded#

Every 15 minutes, for each connected workspace with mappings, the worker selects conversions that:

  • belong to a mapped offer and event;
  • are approved (or pending, when included) and not duplicates;
  • carry a Google click identifier — gclid, else gbraid, else wbraid;
  • are at most 90 days old;
  • were not uploaded to that conversion action yet.

Each conversion is sent with:

Google fieldValue
gclid / gbraid / wbraidthe identifier (one per conversion)
conversionActionthe mapped action
conversionDateTimeconversion time in the workspace time zone, yyyy-mm-dd hh:mm:ss+hh:mm
conversionValue, currencyCodeper Conversion value (omitted for No value)
orderIdthe advertiser's order ID (adv_txid), else the conversion ID
userIdentifiersenhanced conversions only, gclid uploads only: hashedEmail, hashedPhoneNumber

Enhanced conversions#

The e-mail comes from the postback parameter em, else from email=, and the phone from phone or ph. Plain values are normalised (trimmed, lower-cased; phone digits only, at least 6) and SHA-256 hashed; values that already are 64-character hex hashes are sent as they are.

email= is never stored in clear: TrackCrown keeps only its normalised SHA-256 hash (also used for e-mail ownership attribution), and the uploader sends that hash. Both em= and email= work for enhanced conversions; when both are sent, em wins.

URL
https://trackcrown.com/pb?click_id=CLICKID&event=sale&amount=49.90&txid=ORDER-1001&em=jane%40example.com&ph=%2B14155550100&token=TOKEN

Upload log#

Every conversion × action gets one row in the Upload log (on this tab and on Google Ads → API uploads). The header counts the last 30 days: uploaded, failed, skipped.

ColumnMeaning
TimeLast attempt.
Resultuploaded or failed.
OfferOffer and event.
Conversion actionThe mapped action.
Click IDgclid=…, gbraid=… or wbraid=….
ValueUploaded value and currency.
EnhancedWhether user identifiers were attached.
TriesAttempts so far.
Google's answerGoogle's error for failed rows.

Failed rows are retried up to 3 times, an hour apart.

Push the tracking template#

Push the tracking template sets the account-level tracking template in Google Ads (CustomerService.MutateCustomer).

  1. Build a template on the Tracking template tab (link Build a template).
  2. Paste it into the box and click Push to Google Ads.

Only templates on a certified tracking domain that pass every linter check are accepted; otherwise the push is refused with the first error, e.g. "The template is not accepted: … is not yet certified by Google". Lower-level templates in Google Ads still override the account template.

Cost import#

With Import campaign costs on, yesterday and today (workspace time zone) are imported every 3 hours per campaign: cost in the account currency, impressions and clicks. Results appear on Integrations → Ad costs & ROAS, where the Google Ads tile reads connected. See Ad costs & ROAS.

Pause, reconnect, disconnect#

  • Pause uploads / Resume uploads — stops and restarts uploads without losing settings.
  • Reconnect — runs the Google consent again (for example after access was revoked).
  • Disconnect — stops uploads and cost imports and deletes the stored refresh token. The upload log is kept. Revoke the app in your Google account too if you no longer use it.

Troubleshooting#

ProblemFix
Connect Google Ads is missingYou need the Admin role, and the platform app must be configured.
Nothing uploadsCheck Upload conversions every 15 minutes, the mappings, and that conversions carry a gclid/gbraid/wbraid.
Rows failRead Google's answer. Common causes: the click belongs to another Google Ads account than the connected customer, the click is older than the action's click-through window, or the action is not an Import → clicks action.
Enhanced is always offTurn on enhanced conversions and send em= / ph= on the postback; only gclid uploads carry identifiers.
Push refusedUse a certified domain and fix every linter error first.
Something unclear or missing in this article?Tell us