google.json file. This page walks through each one.
Prerequisites
- A Google Ads account you want to manage
- A Google account to sign in with — it owns the manager account and approves access
- The Google Cloud console (creating a project is free)
curlfor the final step (preinstalled on macOS and Linux)
Create and link a manager account
Google issues developer tokens only to a manager account — an umbrella Google Ads account (you may see it called “My Client Center” or MCC) that sits above your regular ad accounts and manages them. Already have one? Skip to the next step.
- Create a manager account at Google Ads → Manager accounts.
- In the manager account, click Link existing account, enter the Customer ID of the account you want to manage (the
xxx-xxx-xxxxshown top-right in that account), and click Send request. - Sign in to that account, open Admin → Access and security → Managers, and Accept the request.
Apply for a developer token
In your manager account, open Admin → API Center and request a token (Google’s guide walks through the form). New tokens start with test access, which reaches only test accounts — so apply for basic access to use your real account.Google reviews each basic-access request and usually replies by email in 3–5 business days, often asking what you’ll use the API for. Reply promptly — something like this clears review:
Create an OAuth client
- In the Google Cloud console, create a project (or pick one) and enable the Google Ads API for it.
- Configure the OAuth consent screen (you may find it under Google Auth Platform): choose External, add an app name and support email, and list your own Google account under Test users.
- Open Clients → Create client, set Application type to Desktop app, and click Create. Desktop clients allow
localhostredirects automatically, so there’s no redirect URL to set. - Copy the Client ID and Client secret — your
client_idandclient_secret.
Get a refresh token
There’s no app running to catch Google’s response, so do this by hand:
-
Open this URL in a browser (paste in your
client_id), sign in as the user with access to the ad account, and approve:access_type=offlineandprompt=consentare what make Google return a refresh token. -
The browser lands on
http://localhost:3000/?code=...and shows a connection error — that’s expected, nothing is running there. Copy the value aftercode=from the address bar (up to the next&); if it contains%2F, change that to/. -
In a terminal, run the command below to exchange the code for a refresh token. Do it right away — the code is single-use and expires fast:
The response contains your
refresh_token.
Assemble the credentials file
Put all six values into onegoogle.json file:
developer_token— from your manager account’s API Center.client_id/client_secret— from your OAuth client.refresh_token— from the exchange above.login_customer_id— your manager account’s ID, digits only (no dashes).customer_id— your ad account’s ID, digits only (Google shows it as987-654-3210top-right). This is the value you pass toadjar import --account.
Point Adjar at the file
Save the file anywhere, then point Adjar at it:--credentials takes priority over ADJAR_CREDENTIALS. Either way, give the path to the JSON file, not a folder. There are no implicit or default locations — credentials are always explicit.
With google.json ready, head to the Quick Start to import your account.