• MediaLauncher
  • Posts
  • How to connect to the Google Ads API in < 30 mins

How to connect to the Google Ads API in < 30 mins

A quick guide on how to start automating your accounts

Cool tools I found last week

DEEP DIVE

How to connect to the Google Ads API and automate your accounts 🚀

A 30-minute guide on how to start turning your Google Ads accounts into self-driving growth machines.

1. Secure Your Developer Token (≈ 5 min)

  1. Create or reuse a Google Ads Manager (MCC) account. Non-manager accounts can’t request developer tokens.

  2. Go to Admin ▸ API Center in the Google Ads UI and click “Apply”.

  3. Fill out the request form. Describe what you plan to build, include a customer ID (a test account is fine), and acknowledge compliance with rate limits and policies.

  4. Wait for approval (typically 24–48 hours). Your token will show up in the API Center.

  5. In the meantime, use the provisional token with a test account to prototype your script.

Pro tip: Attach a short Loom video or a Google Doc to your application explaining your use case. It helps reviewers approve it faster.

2. Set Up OAuth 2.0 Credentials (≈ 7 min)

  1. In your Google Cloud project, enable the Google Ads API.

  2. Configure the OAuth consent screen. Add a support email, your Google account as a test user, and optionally a logo.

  3. Create OAuth 2.0 credentials:

    • Choose Web app if you’ll connect through a no-code tool.

    • Choose Desktop app if you’re working locally in Python.

    • Copy your Client ID and Client Secret.

  4. Set Authorized JavaScript origins and Authorized redirect URI:

    • Under Authorized JavaScript origins, leave this empty if you're using a desktop app or local script.

    • Under Authorized redirect URIs, click "Add URI" and paste the following:

      • For local scripts: http://localhost

      • For tools like Zapier, Make, or n8n: use the specific redirect URL provided in that tool's OAuth setup or app configuration screen.

  5. Make sure to save the changes before proceeding.

3. No-Code Route: Zapier, Make, n8n (≈ 15 min total)

Google Cloud Setup (One-Time)

  1. In your Google Cloud project, set the Authorized redirect URI.

  2. Get the correct redirect URI for your tool:

    • Zapier: Open your connected app’s settings → copy the "Redirect URL" shown there.

    • Make (Integromat): Go to the Google Ads OAuth2 module → copy the listed redirect URI.

    • n8n (cloud/self-hosted): Open credential settings → the redirect URI is shown next to the OAuth2 type.

  3. Paste the redirect URI into your Google Cloud credential settings.

  4. Copy your Client ID and Client Secret.

Connect OAuth Credentials to the Tool

Tool

Where to Paste

Headers to Add

Zapier

Use Zapier's Auth/Token URLs

developer-token: YOUR_DEV_TOKEN``login-customer-id: 123-456-7890 (optional)

Make

Paste creds in OAuth2 connection

Add developer-token in each HTTP module

n8n

Use “Google OAuth2 (Generic)”

Add developer-token in HTTP node headers

Test the Connection

Run:

GET <https://googleads.googleapis.com/v19/customers:listAccessibleCustomers>

If you get a 200 OK, you're good to go.

4. Connect Using Python (≈ 5 min)

Get a Refresh Token

  1. Install the helper tool:

pip install google-ads-oauth2
  1. Run the script:

google-ads-oauth2 --client_id=YOUR_CLIENT_ID --client_secret=YOUR_CLIENT_SECRET
  1. Log in through the browser. After authentication, you’ll receive a refresh token in your terminal. Copy and store it securely.

  2. Set Up your google-ads.yaml file

developer_token: YOUR_DEV_TOKEN
client_id: YOUR_CLIENT_ID
client_secret: YOUR_CLIENT_SECRET
refresh_token: YOUR_REFRESH_TOKEN
  1. Test the Connection

from google.ads.googleads.client import GoogleAdsClient

client = GoogleAdsClient.load_from_storage("google-ads.yaml")
ga_service = client.get_service("GoogleAdsService")

query = "SELECT customer.id, customer.descriptive_name FROM customer LIMIT 5"
for row in ga_service.search_stream(customer_id="INSERT_ID", query=query):
    print(row.customer.descriptive_name)

5. What to Automate First

  • Budget pacing and pausing based on spend.

  • Slack alerts for disapproved or limited ads.

  • Daily or weekly search term exports to BigQuery.

  • Anything that removes you from repetitive, manual tasks.

GET HELP ON PPC & CUSTOM AUTOMATION

If you’re you’re looking to take your ads game to the next level, consider hiring us to scale your Google & Meta Ads accounts, as well as save 100s of hours on manual work via custom automation.

Book a free 30-minute strategy session where I'll identify specific improvement areas for your accounts and / or for your team, define project scopes, and address potential constraints.

Afterward, you'll receive a comprehensive briefing, for free, with PPC & automation scenarios you can implement yourself or outsource to my team.

Platforms we run & automate: Google Ads, Meta Ads, Linkedin Ads, Native, & more.

The tools we use: Custom scripts, Zapier, Make, n8n, Supermetrics, Funnel, & more.

Have questions or feedback? Hit reply. Loved it? Share it!