Skip to content
smartargs
EarnbackDocumentation

Google Ads

Reads campaigns, daily spend, ad networks (Search, Display, YouTube…) and App campaign assets (videos, images, headlines) with their performance labels.

"google-ads": { "enabled": true, "customerId": "123-456-7890", "auth": "service-account" }
Setting Meaning
customerId The 10-digit id at the top right of Google Ads (dashes optional).
loginCustomerId Only when you reach the account through a manager account: the manager’s id.
auth service-account (default) or oauth (your own Google login).

A service account is a robot Google user that only your machine can act as. Nothing expires.

  1. In the Google Cloud console, create a project (or pick the one you already use for Firebase).
  2. Enable the Google Ads API.
  3. Create a service account (no roles needed), open it → Keys → Add key → JSON.
  4. Save the key as google-service-account.json in your secrets folder (earnback doctor prints the path), or map it in the config’s secrets.
  5. In Google Ads, open Admin → Access and security → Users → + and invite the service account’s email (…@….iam.gserviceaccount.com) with Read only access.

The same key also serves GA4 ("auth": "service-account" there), so one file covers both.

Option B: your own login

Set "auth": "oauth", then follow the Google login steps in admob.md (an OAuth desktop client of your own) and run earnback connect google. One login covers Google Ads, GA4 with oauth and AdMob.

What it reads

  • Campaigns: name, status, daily budget, target cost per install/action, the conversion it optimises for, start and end, locations and languages.
  • Daily spend, impressions, clicks (“taps”) and Google’s own conversion count per campaign. Google Ads reports no country breakdown here, so a country filter shows “–” for Google spend.
  • Spend per ad network (Search, Display, YouTube, Discover…).
  • App campaign assets per day with Google’s performance label (Best, Good, Low, Learning).

The last 30 days are re-read on every sync, because Google keeps revising conversions.

Caveats

  • Google’s conversions are its own, partly modelled count. Earnback shows them in grey and never compares them across channels; players come from GA4.
  • One App ad impression counts for a video, a headline and a description at once, so compare assets within a kind (videos with videos).
  • Earnback calls the API without a developer token, which works for reading your own account. If Google answers that a developer token is required, please open an issue with the message.

Errors

Message Fix
Google Ads answered 403 Add the service account (or your login) as a Read only user in Google Ads, and enable the Google Ads API in the Cloud project the key belongs to.
No Google service account key Save the JSON key where the hint says, or use "auth": "oauth".
USER_PERMISSION_DENIED with a manager account Set loginCustomerId to the manager’s id.