Google API Setup
Configure Google Ads API v18 OAuth 2.0 credentials to enable live campaign push from the Marketing Hub.
π Connection Status
Current Google Ads OAuth connection status
Google Ads OAuth
Checkingβ¦
π Setup Guide β Google Ads API v18
Follow these steps to get your credentials and enable live campaign push.
1
Create a Google Cloud Project
Go to console.cloud.google.com, create a new project (e.g.
911-marketing-hub), and enable the Google Ads API under APIs & Services β Library.
2
Create OAuth 2.0 Credentials
APIs & Services β Credentials β Create Credentials β OAuth Client ID.
Application type: Web application.
Add authorized redirect URI:
Application type: Web application.
Add authorized redirect URI:
https://services-leads-marketing-hub.pages.dev/api/auth/google/callback
Save your Client ID and Client Secret.
3
Apply for Google Ads API Access
Go to Google Ads Manager β Tools β API Center.
Apply for a Developer Token. Start with Basic access (test account). You'll receive a token like
Apply for a Developer Token. Start with Basic access (test account). You'll receive a token like
ABcdEf1234567890.
4
Add Environment Variables to Cloudflare
In Cloudflare Pages β Settings β Environment Variables, add:
GOOGLE_ADS_DEVELOPER_TOKEN = your-developer-token
GOOGLE_ADS_CLIENT_ID = your-client-id.apps.googleusercontent.com
GOOGLE_ADS_CLIENT_SECRET = your-client-secret
GOOGLE_ADS_CUSTOMER_ID = your-ads-account-id (digits only)
5
Authorize via OAuth
After deploying with the env vars set, click Connect Google Account above. This starts the OAuth 2.0 flow and stores refresh tokens in your KV namespace for future API calls.
π§ All Environment Variables
Set these in Cloudflare Pages β Settings β Environment Variables (Production)
| Variable | Description | Required |
|---|---|---|
GOOGLE_ADS_DEVELOPER_TOKEN | From Google Ads Manager API Center | Required |
GOOGLE_ADS_CLIENT_ID | OAuth 2.0 Client ID from Google Cloud Console | Required |
GOOGLE_ADS_CLIENT_SECRET | OAuth 2.0 Client Secret | Required |
GOOGLE_ADS_CUSTOMER_ID | Google Ads account ID (numbers only, no dashes) | Required |
CLOUDFLARE_API_TOKEN | For deploying landing pages to Cloudflare Pages | Optional |
CLOUDFLARE_ACCOUNT_ID | Your Cloudflare account ID | Optional |
TELEGRAM_BOT_TOKEN | Telegram bot token for lead notifications | Optional |
TELEGRAM_CHAT_ID | Telegram chat/channel ID for notifications | Optional |
META_ACCESS_TOKEN | Meta (Facebook) access token for Meta Ads push | Optional |
META_AD_ACCOUNT_ID | Meta ad account ID | Optional |
βοΈ Cloudflare Bindings (Already Configured)
These are set in wrangler.jsonc and bound to this deployment.
KV Namespace : KV β 40cccfe0b3734c3a8c16300e3300e6aa
D1 Database : DB β 911-marketing-hub-production (04f5ae3a-2273-49e5-8927-e7dcfa0afac1)