Connect Google Ads to n8n?
This guide shows how to Connect Google Ads to n8n for simple automation. Yes, you can connect Google Ads to n8n by creating OAuth2 credentials, running n8n in Docker, and authenticating the Google Ads credential inside n8n. The steps below use Node.js, Docker, and the Google Ads API.
What You Need
- A Google Cloud project with billing enabled.
- Access to the Google Cloud Console to create OAuth2 credentials.
- A machine with Docker and Node.js (for local n8n or development).
- An n8n instance reachable at a URL for OAuth redirect (localhost or domain).
Step 1: Enable the Google Ads API and set the redirect URL
Enable the API in your project and prepare the redirect URI. For local testing use:
http://localhost:5678/rest/oauth2-credential/callback
To enable the API with gcloud:
gcloud services enable googleads.googleapis.com --project=YOUR_PROJECT_ID
Step 2: Connect Google Ads to n8n by creating OAuth credentials
Create an OAuth client in the Google Cloud Console.
- Open APIs & Services > OAuth consent screen. Configure external user type and add your email.
- Open Credentials > Create Credentials > OAuth client ID.
- Select Web application. Add the redirect URI from above.
- Save the Client ID and Client Secret.
Step 3: Run n8n with Docker
Start n8n so the OAuth flow can redirect to it. Use basic auth in production. For local testing run:
docker run -it --rm --name n8n -p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE=true \
-e N8N_BASIC_AUTH_USER=n8nuser \
-e N8N_BASIC_AUTH_PASSWORD=secret \
-e N8N_HOST=localhost \
n8nio/n8n:latest
If you host on a domain, set N8N_HOST and use HTTPS so OAuth redirects work.
Step 4: Add Google Ads credentials inside n8n
- Open n8n in your browser and log in.
- Go to Credentials > New > Google Ads OAuth2.
- Paste the Client ID and Client Secret from Google Cloud.
- Click Authenticate to start the OAuth flow. Grant access to the Google Ads account.
- Save the credential. n8n will store the access token and refresh token.
Step 5: Create a simple workflow to list campaigns
Add a Google Ads node and a Debug node. Configure the Google Ads node to call the “Customer” or “Campaign” service. Use the credential you saved.
// Example: Use the Google Ads node to run a GAQL query inside n8n
// In n8n's Google Ads node, set the operation to 'Search' and query:
SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id
Execute the workflow to fetch campaigns. The node will use the saved OAuth tokens automatically.
Update
Keep your n8n image up to date. Pull the latest Docker image periodically. Example:
docker pull n8nio/n8n:latest
docker stop n8n && docker rm n8n
# Then run the docker run command from Step 3 again
Also refresh your Google Cloud OAuth consent settings if you change scopes.
Security
- Never commit Client ID or Client Secret to source control.
- Use HTTPS and a proper domain for production OAuth redirects.
- Enable n8n basic auth or a gateway auth for public instances.
- Use environment secrets or a secret manager for production credentials.
- Limit the OAuth consent scopes to only what you need (least privilege).
Done
You now know how to Connect Google Ads to n8n and run a basic workflow. This setup uses OAuth2 so n8n can call the Google Ads API securely. Test the workflow and expand it to automate reporting, campaign updates, or alerts.