To integrate Google Ads with Bolt.new, create a Google Ads developer token (requires a Manager account and up to 72-hour approval), set up OAuth 2.0 credentials in Google Cloud Console, then prompt Bolt to build a campaign dashboard using the `google-ads-api` npm package. Bolt generates an API route that runs GAQL queries to fetch impressions, clicks, and cost data. OAuth callback URLs require a deployed URL — OAuth flows cannot run in Bolt's WebContainer preview.
Build a Custom Google Ads Campaign Dashboard with Bolt.new
Google Ads is one of the most powerful advertising platforms available, but its native reporting interface lacks the flexibility that agencies and in-house marketing teams need. By connecting Google Ads to a Bolt.new app, you can build a custom campaign management dashboard tailored to your exact KPIs — fetching live campaign data, visualizing spend vs. conversions, and surfacing the metrics your team cares about without navigating Google's sprawling UI.
The Google Ads API uses GAQL (Google Ads Query Language), a SQL-like syntax for querying campaign data such as impressions, clicks, average CPC, cost, and conversions. The `google-ads-api` npm package handles the gRPC-to-REST translation, making it straightforward to call from a Next.js API route. Authentication works through OAuth 2.0 — users authorize the app with their Google account, and the refresh token allows the API route to fetch data server-side without re-prompting for login. This server-side pattern keeps your developer token and client secret out of client-side code entirely.
One critical difference from most API integrations: the Google Ads API requires a developer token that must be approved by Google. Applying through a Manager (MCC) account is mandatory, and approval can take up to 72 hours. During development and testing, a test account with a basic-access developer token is sufficient. Once approved for standard access, your token can query real production campaigns. Plan this lead time into your project timeline — everything else in the integration can be built and tested while waiting for token approval.
Integration method
Google Ads connects to Bolt.new through a Next.js API route that uses the `google-ads-api` npm package to run GAQL (Google Ads Query Language) queries against the Google Ads API. You configure OAuth 2.0 credentials in Google Cloud Console and store your developer token, client ID, client secret, and refresh token as environment variables. Bolt generates the API route, dashboard components, and chart code from a single prompt. OAuth callback URLs and the full authorization flow require a deployed URL — the WebContainer preview cannot handle OAuth redirects.
Prerequisites
- A Google Ads Manager (MCC) account — individual advertiser accounts cannot apply for a developer token
- A Google Ads developer token (apply at Google Ads API Center; approval takes up to 72 hours)
- A Google Cloud project with the Google Ads API enabled and OAuth 2.0 credentials created
- An OAuth 2.0 refresh token for the Google account that has access to the Ads account
- A deployed URL on Netlify or Vercel for OAuth callback registration (required for the full user-authorization flow)
Step-by-step guide
Obtain a Google Ads Developer Token
Obtain a Google Ads Developer Token
Before writing any code, you need a Google Ads developer token — a prerequisite unique to the Google Ads API that has no equivalent in most other API integrations. A developer token is tied to a Manager account (also called a My Client Center or MCC account), not to a regular advertiser account. If you only have a standard Google Ads account, you must first create a Manager account at ads.google.com/home/tools/manager-accounts/. Once you have a Manager account, navigate to Tools and Settings → Setup → API Center within your Manager account dashboard. Fill in the application details: select your use case (reporting, campaign management, or both), describe your application, and submit the request. Google reviews developer token applications manually — approval typically takes 24 to 72 hours, though it can occasionally take longer. While waiting for approval, you receive a test-account developer token immediately. This test token can only query test accounts (Google Ads test accounts you create in the API Center), but it is sufficient to build and validate your entire integration before approval arrives. Standard access tokens unlock queries against real production campaign data. When your token is approved, it appears as a string in the API Center — copy it and store it securely. This token is added to the request headers of every Google Ads API call and must be kept server-side at all times.
Pro tip: Apply for your developer token the moment you start this project — the 24-72 hour approval window is the only blocker you cannot parallelize. Everything else can be built and tested with a test-account token while you wait.
Expected result: You have a developer token (test or approved) visible in Google Ads API Center and stored securely outside of any code repository.
Configure OAuth 2.0 Credentials in Google Cloud Console
Configure OAuth 2.0 Credentials in Google Cloud Console
The Google Ads API uses OAuth 2.0 for authentication, meaning users authorize your app to access their Google Ads data. Setting this up requires creating credentials in Google Cloud Console. Start at console.cloud.google.com — create a new project or use an existing one. Enable the Google Ads API: go to APIs and Services → Library, search for 'Google Ads API', and click Enable. Next, create OAuth 2.0 credentials: go to APIs and Services → Credentials → Create Credentials → OAuth 2.0 Client IDs. Choose 'Web application' as the application type. Under Authorized Redirect URIs, add your production callback URL (e.g., `https://your-app.netlify.app/api/auth/callback/google-ads`). During development you can also add `http://localhost:3000/api/auth/callback/google-ads`, but the full OAuth flow still requires a reachable URL for the callback — it will not work inside Bolt's WebContainer preview. After creating the credentials, download the JSON file — it contains your `client_id` and `client_secret`. To obtain a refresh token (which allows server-side API calls without re-prompting the user), use Google's OAuth 2.0 Playground at developers.google.com/oauthplayground. In Step 1, enter the scope `https://www.googleapis.com/auth/adwords`, authorize with the Google account that has access to your Ads account, then exchange the authorization code for a refresh token in Step 2. Copy the refresh token — this is long-lived and lets your API route authenticate silently. Store `client_id`, `client_secret`, and `refresh_token` in your `.env` file.
1# .env2GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token_here3GOOGLE_ADS_CLIENT_ID=your_oauth_client_id.apps.googleusercontent.com4GOOGLE_ADS_CLIENT_SECRET=your_oauth_client_secret5GOOGLE_ADS_REFRESH_TOKEN=your_refresh_token_from_oauth_playground6GOOGLE_ADS_CUSTOMER_ID=1234567890Pro tip: The customer ID in the Google Ads API is the 10-digit number shown in your Google Ads account (without dashes). For Manager accounts querying child accounts, use the child account's customer ID in individual API calls — the Manager ID is used only for listing accessible accounts.
Expected result: You have a client ID, client secret, refresh token, and developer token in your .env file, and a working OAuth 2.0 app registered in Google Cloud Console.
Prompt Bolt to Generate the Campaign Dashboard
Prompt Bolt to Generate the Campaign Dashboard
With credentials in hand, use Bolt's chat to generate the campaign dashboard. Be specific in your prompt — name the API route path, list the GAQL fields you need, specify the chart library (Recharts is built into most Bolt Next.js templates), and mention the environment variable names so Bolt uses exactly what you've defined in your .env file. Bolt generates several files: the Next.js API route at `app/api/google-ads/campaigns/route.ts` that initializes the `google-ads-api` client, constructs the GAQL query, executes the search, and returns structured JSON; a `CampaignDashboard` component that fetches from the API route using `useEffect` and renders the results in a table and chart; and the necessary TypeScript types for the campaign data structure. Review the generated API route carefully — check that the GAQL query includes the fields you need and that the `customer_id` is read from `process.env.GOOGLE_ADS_CUSTOMER_ID`. The `google-ads-api` package abstracts the gRPC layer, but the query syntax itself follows GAQL conventions: `SELECT campaign.name, metrics.impressions, metrics.clicks FROM campaign WHERE campaign.status = 'ENABLED' AND segments.date DURING LAST_30_DAYS`. Bolt often generates a working query but may need minor field name corrections — cross-reference with the Google Ads API field reference if you see 'invalid field' errors.
Build a Google Ads campaign performance dashboard using Next.js. Install the google-ads-api npm package. Create an API route at app/api/google-ads/campaigns/route.ts that initializes a GoogleAdsApi client using GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_REFRESH_TOKEN, and GOOGLE_ADS_CUSTOMER_ID from process.env. Use a Customer object to run this GAQL query: SELECT campaign.id, campaign.name, campaign.status, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.average_cpc, metrics.conversions, metrics.cost_per_conversion FROM campaign WHERE campaign.status = 'ENABLED' AND segments.date DURING LAST_30_DAYS ORDER BY metrics.cost_micros DESC. Return the results as JSON, converting cost_micros to dollars by dividing by 1000000. Create a CampaignDashboard component that fetches this data and displays it in a sortable table with columns for Campaign Name, Impressions, Clicks, CTR, Spend, and Conversions. Add a Recharts LineChart showing daily spend over time using a second GAQL query that includes segments.date.
Paste this in Bolt.new chat
1// app/api/google-ads/campaigns/route.ts2import { NextResponse } from 'next/server';3import { GoogleAdsApi } from 'google-ads-api';45const client = new GoogleAdsApi({6 client_id: process.env.GOOGLE_ADS_CLIENT_ID!,7 client_secret: process.env.GOOGLE_ADS_CLIENT_SECRET!,8 developer_token: process.env.GOOGLE_ADS_DEVELOPER_TOKEN!,9});1011export async function GET() {12 try {13 const customer = client.Customer({14 customer_id: process.env.GOOGLE_ADS_CUSTOMER_ID!,15 refresh_token: process.env.GOOGLE_ADS_REFRESH_TOKEN!,16 });1718 const campaigns = await customer.query(`19 SELECT20 campaign.id,21 campaign.name,22 campaign.status,23 metrics.impressions,24 metrics.clicks,25 metrics.cost_micros,26 metrics.average_cpc,27 metrics.conversions,28 metrics.cost_per_conversion29 FROM campaign30 WHERE campaign.status = 'ENABLED'31 AND segments.date DURING LAST_30_DAYS32 ORDER BY metrics.cost_micros DESC33 `);3435 const data = campaigns.map((row: any) => ({36 id: row.campaign.id,37 name: row.campaign.name,38 status: row.campaign.status,39 impressions: row.metrics.impressions,40 clicks: row.metrics.clicks,41 spend: (row.metrics.cost_micros / 1_000_000).toFixed(2),42 averageCpc: (row.metrics.average_cpc / 1_000_000).toFixed(2),43 conversions: row.metrics.conversions,44 costPerConversion: row.metrics.cost_per_conversion45 ? (row.metrics.cost_per_conversion / 1_000_000).toFixed(2)46 : null,47 }));4849 return NextResponse.json({ campaigns: data });50 } catch (error: any) {51 console.error('Google Ads API error:', error);52 return NextResponse.json(53 { error: error.message || 'Failed to fetch campaign data' },54 { status: 500 }55 );56 }57}Pro tip: Google Ads API returns monetary values in micros (millionths of the account currency). Always divide cost_micros, average_cpc, and cost_per_conversion by 1,000,000 to get the actual dollar amount before displaying or storing values.
Expected result: Bolt generates a working API route and campaign dashboard component. The API route returns structured campaign data, and the dashboard renders a sortable table and spend chart populated with live metrics.
Test the Dashboard in Bolt's Preview
Test the Dashboard in Bolt's Preview
In Bolt's WebContainer preview, the campaign dashboard can be partially tested — outbound HTTP calls from the Next.js API route to the Google Ads API work correctly because they are outbound connections initiated by the server. However, the OAuth flow (the initial authorization and callback redirect) cannot complete in the preview because the callback URL must be a publicly reachable URL registered in Google Cloud Console, which the WebContainer cannot provide. For the dashboard use case — where you have already obtained a refresh token via the OAuth Playground — the API route works without any interactive OAuth step. Set your .env variables in Bolt's environment and open the preview to load the dashboard. The API route initializes the Google Ads API client using the stored refresh token, runs the GAQL query, and returns data silently. If the API route returns a 500 error in the preview, open the browser console and check the error message. Common issues at this stage: the `google-ads-api` package using a field name that does not match the GAQL specification (check the exact field name at developers.google.com/google-ads/api/fields), the customer ID format being incorrect (should be digits only, no dashes), or the developer token being a test token while querying a non-test account. For the test-account token scenario, create a Google Ads test account in the API Center and use that account's customer ID during development.
Update the Google Ads campaign dashboard to show a loading skeleton while data is being fetched from the API route, and display a descriptive error message if the API call fails. Add a date range selector with options for Last 7 days, Last 30 days, and Last 90 days that passes a range parameter to the API route and adjusts the GAQL query's DURING clause accordingly.
Paste this in Bolt.new chat
1// app/api/google-ads/campaigns/route.ts — date range support2import { NextRequest, NextResponse } from 'next/server';3import { GoogleAdsApi } from 'google-ads-api';45const client = new GoogleAdsApi({6 client_id: process.env.GOOGLE_ADS_CLIENT_ID!,7 client_secret: process.env.GOOGLE_ADS_CLIENT_SECRET!,8 developer_token: process.env.GOOGLE_ADS_DEVELOPER_TOKEN!,9});1011const DATE_RANGES: Record<string, string> = {12 '7': 'LAST_7_DAYS',13 '30': 'LAST_30_DAYS',14 '90': 'LAST_90_DAYS',15};1617export async function GET(request: NextRequest) {18 const { searchParams } = new URL(request.url);19 const range = searchParams.get('range') ?? '30';20 const during = DATE_RANGES[range] ?? 'LAST_30_DAYS';2122 const customer = client.Customer({23 customer_id: process.env.GOOGLE_ADS_CUSTOMER_ID!,24 refresh_token: process.env.GOOGLE_ADS_REFRESH_TOKEN!,25 });2627 const campaigns = await customer.query(`28 SELECT29 campaign.id,30 campaign.name,31 metrics.impressions,32 metrics.clicks,33 metrics.cost_micros,34 metrics.conversions35 FROM campaign36 WHERE campaign.status = 'ENABLED'37 AND segments.date DURING ${during}38 ORDER BY metrics.cost_micros DESC39 `);4041 const data = campaigns.map((row: any) => ({42 id: row.campaign.id,43 name: row.campaign.name,44 impressions: row.metrics.impressions,45 clicks: row.metrics.clicks,46 spend: (row.metrics.cost_micros / 1_000_000).toFixed(2),47 conversions: row.metrics.conversions,48 }));4950 return NextResponse.json({ campaigns: data, range: during });51}Pro tip: If you need to implement the full OAuth user-authorization flow (letting other users connect their own Google Ads accounts), that requires a deployed URL. Use a test account with a pre-generated refresh token during development to avoid this dependency.
Expected result: The dashboard loads campaign data in the preview, shows a loading state while fetching, and the date range selector correctly refreshes the table and chart with data for the chosen period.
Deploy and Configure OAuth Redirect URIs
Deploy and Configure OAuth Redirect URIs
Once the dashboard works in Bolt's preview using a pre-configured refresh token, deploy to Netlify or Vercel to enable the full OAuth flow and make the app accessible to other users. In Netlify, connect your GitHub repository, set the build command to `npm run build`, and add all five environment variables in Site Configuration → Environment Variables: `GOOGLE_ADS_DEVELOPER_TOKEN`, `GOOGLE_ADS_CLIENT_ID`, `GOOGLE_ADS_CLIENT_SECRET`, `GOOGLE_ADS_REFRESH_TOKEN`, and `GOOGLE_ADS_CUSTOMER_ID`. After the first deployment, copy your production URL (e.g., `https://your-app.netlify.app`). Return to Google Cloud Console → APIs and Services → Credentials → your OAuth 2.0 client → Authorized Redirect URIs. Add your production callback URL: `https://your-app.netlify.app/api/auth/callback/google-ads`. Without this step, any attempt to authorize a new Google account will fail with a 'redirect_uri_mismatch' error. If your app is a multi-user tool where each user connects their own Google Ads account, implement a proper OAuth flow in Next.js API routes that stores each user's refresh token in a database such as Supabase. The single-account pattern with a pre-configured refresh token is appropriate for internal dashboards or agency tools where one set of credentials covers all the accounts you need. For SaaS apps where each user manages their own ad account, the full user-facing OAuth flow is required and Bolt can generate it from a single prompt.
Add an OAuth 2.0 connection flow so users can connect their own Google Ads accounts. Create an API route at app/api/auth/google-ads/route.ts that redirects to Google's OAuth authorization URL with scope https://www.googleapis.com/auth/adwords and access_type=offline. Create a callback route at app/api/auth/callback/google-ads/route.ts that exchanges the authorization code for a refresh token using GOOGLE_ADS_CLIENT_ID and GOOGLE_ADS_CLIENT_SECRET from process.env, then stores the refresh token in Supabase linked to the user's account. Use the stored refresh token for all subsequent Google Ads API calls for that user.
Paste this in Bolt.new chat
1// app/api/auth/google-ads/route.ts2import { NextResponse } from 'next/server';34export async function GET() {5 const params = new URLSearchParams({6 client_id: process.env.GOOGLE_ADS_CLIENT_ID!,7 redirect_uri: `${process.env.NEXT_PUBLIC_APP_URL}/api/auth/callback/google-ads`,8 response_type: 'code',9 scope: 'https://www.googleapis.com/auth/adwords',10 access_type: 'offline',11 prompt: 'consent',12 });1314 return NextResponse.redirect(15 `https://accounts.google.com/o/oauth2/v2/auth?${params.toString()}`16 );17}1819// app/api/auth/callback/google-ads/route.ts20import { NextRequest, NextResponse } from 'next/server';2122export async function GET(request: NextRequest) {23 const { searchParams } = new URL(request.url);24 const code = searchParams.get('code');2526 if (!code) {27 return NextResponse.json({ error: 'No authorization code' }, { status: 400 });28 }2930 const tokenResponse = await fetch('https://oauth2.googleapis.com/token', {31 method: 'POST',32 headers: { 'Content-Type': 'application/x-www-form-urlencoded' },33 body: new URLSearchParams({34 code,35 client_id: process.env.GOOGLE_ADS_CLIENT_ID!,36 client_secret: process.env.GOOGLE_ADS_CLIENT_SECRET!,37 redirect_uri: `${process.env.NEXT_PUBLIC_APP_URL}/api/auth/callback/google-ads`,38 grant_type: 'authorization_code',39 }),40 });4142 const tokens = await tokenResponse.json();43 // Store tokens.refresh_token in your database linked to the current user44 return NextResponse.redirect(`${process.env.NEXT_PUBLIC_APP_URL}/dashboard`);45}Pro tip: Google only returns a refresh_token on the first authorization. Include prompt=consent and access_type=offline in the OAuth URL to force a new refresh token to be issued — without these parameters, repeat authorizations from the same account will not include a refresh token.
Expected result: The deployed app loads with live campaign data. New users can connect their own Google Ads accounts via the OAuth flow. The redirect URI is registered in Google Cloud Console and authorization completes without a redirect_uri_mismatch error.
Common use cases
Campaign Performance Overview Dashboard
Build a real-time dashboard that aggregates campaign-level metrics — impressions, clicks, CTR, average CPC, total spend, and conversions — across all active campaigns in a Google Ads account. Visualize spend trends over time with a line chart and surface the top-performing campaigns in a sortable table.
Build a Google Ads campaign performance dashboard. Create an API route at app/api/google-ads/campaigns/route.ts that uses the google-ads-api package to fetch all active campaigns with their impressions, clicks, cost_micros, average_cpc, and conversions for the last 30 days using a GAQL query. Display the data in a sortable table with a line chart showing daily spend trends. Store GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_REFRESH_TOKEN, and GOOGLE_ADS_CUSTOMER_ID in environment variables.
Copy this prompt to try it in Bolt.new
Ad Group and Keyword Bid Monitor
Create a tool that pulls all ad groups and their top keywords with current bids, quality scores, and search impression share. Alert when a keyword's average position drops below a threshold or when cost per conversion exceeds a configurable limit, so media buyers can act before budget is wasted.
Create a keyword bid monitoring tool using the Google Ads API. Build an API route that fetches all enabled ad groups and their top 20 keywords by impressions, including current bid, quality_score, search_impression_share, average_cpc, conversions, and cost_per_conversion using GAQL. Display in a table with color-coded quality score badges and a warning indicator when cost_per_conversion exceeds a configurable threshold. Use GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_REFRESH_TOKEN, and GOOGLE_ADS_CUSTOMER_ID from .env.
Copy this prompt to try it in Bolt.new
Multi-Account Agency Reporting Tool
Build an agency-grade reporting tool that queries multiple Google Ads accounts connected under a Manager account and generates a consolidated performance summary. Each client account's data is fetched separately and aggregated into a single view sorted by total spend, giving account managers a quick read across their entire book of business.
Build a multi-account Google Ads reporting tool for an agency. Create an API route that uses a Manager account customer ID to list all accessible child accounts, then fetches campaign performance data (impressions, clicks, cost, conversions, ROAS) from each account for the selected date range. Aggregate results into a summary view sorted by total spend. Use GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_REFRESH_TOKEN, and GOOGLE_ADS_MANAGER_CUSTOMER_ID from environment variables.
Copy this prompt to try it in Bolt.new
Troubleshooting
API route returns 'DEVELOPER_TOKEN_NOT_APPROVED' or 'The developer token is not approved for production access'
Cause: Your developer token has basic (test) access and is being used to query a live production Google Ads account. Test-level tokens can only access Google Ads test accounts created within the API Center.
Solution: Either wait for standard access approval from Google (submitted in Ads API Center under your Manager account), or create a Google Ads test account from within the API Center and use that test account's customer ID during development. Once standard access is granted, the same developer token works against production accounts.
OAuth callback fails with 'redirect_uri_mismatch' error after deployment
Cause: The redirect URI used in the OAuth authorization request does not exactly match one of the Authorized Redirect URIs registered in your Google Cloud Console OAuth 2.0 client configuration.
Solution: Copy the exact URL your deployed app uses as the callback path — including https://, the exact domain, and the path such as /api/auth/callback/google-ads. Add it verbatim to Google Cloud Console → APIs and Services → Credentials → your OAuth 2.0 client → Authorized Redirect URIs. Changes take a few minutes to propagate.
GAQL query fails with 'The field does not exist' or 'Unrecognized field' error
Cause: The GAQL field name used in the query is incorrect, misspelled, or incompatible with the resource being queried. Not all metric fields are available for every resource type, and the google-ads-api package's TypeScript types may not catch invalid field names at compile time.
Solution: Check the exact field name and resource compatibility at developers.google.com/google-ads/api/fields. For campaign-level queries, use the campaign resource. Field names follow the pattern resource.field_name (e.g., metrics.cost_micros, campaign.name). Ensure the FROM clause matches the resource you are selecting from.
1// Valid campaign-level GAQL fields:2// campaign.id, campaign.name, campaign.status3// metrics.impressions, metrics.clicks, metrics.cost_micros4// metrics.conversions, metrics.average_cpc, metrics.ctr5// segments.date (for daily breakdowns)67// Invalid in a campaign query — belong to other resources:8// ad_group.clicks (use FROM ad_group, not FROM campaign)9// keyword_view.impressions (use FROM keyword_view)Dashboard API call works in Bolt preview but the OAuth authorization redirect never completes
Cause: Bolt's WebContainer preview runs in the browser and has no public-facing URL. Outbound API calls (querying Google Ads data using a stored refresh token) work fine, but any flow requiring an external service to redirect back to your app — including OAuth authorization callbacks — requires a publicly accessible deployed URL.
Solution: Deploy to Netlify or Vercel to enable OAuth flows. For development without deploying, use Google's OAuth 2.0 Playground (developers.google.com/oauthplayground) to manually generate a refresh token and store it in your .env file — this bypasses the interactive OAuth redirect entirely for single-account dashboard use cases.
Best practices
- Apply for your Google Ads developer token before writing any code — the 24-72 hour approval window is the only blocker you cannot parallelize, so start this process on day one
- Keep your developer token and OAuth credentials (client_secret, refresh_token) in server-side environment variables only — these must never appear in client-side code or be committed to source control
- Use Google Ads test accounts with a basic-access developer token during development — test accounts are fully functional for building and validating the integration without risking production campaign data
- Convert cost_micros to the actual currency amount by dividing by 1,000,000 before displaying or storing monetary values — this applies to cost, average_cpc, and cost_per_conversion
- Cache Google Ads API responses on the server for at least 5 minutes — the API has rate limits and querying on every page load is unnecessary for dashboard use cases where real-time precision is not required
- When building multi-user tools, store each user's refresh token encrypted in your database and never share credentials across user accounts
- Include prompt=consent and access_type=offline in your OAuth authorization URL to ensure a refresh token is always issued — without these parameters Google may skip the refresh token on repeat authorizations
- Test the full OAuth flow on your deployed URL before sharing with users — OAuth redirect URIs must be registered in Google Cloud Console and will not work in Bolt's WebContainer preview
Alternatives
Facebook Ads uses the Graph API with a simpler access token setup (no developer token approval process) and is the better choice for consumer-facing campaigns targeting social media audiences.
Microsoft Advertising reaches Bing's search audience with generally lower CPCs than Google Ads, making it a cost-effective complement for search campaigns targeting desktop users.
Google Analytics provides post-click behavior data (sessions, bounce rate, on-site conversions) and pairs with Google Ads data for full-funnel reporting from impression through conversion.
LinkedIn Ads is the dominant platform for B2B lead generation targeting by job title, company, or industry — where Google's intent-based keyword targeting is less precise for professional audiences.
Frequently asked questions
Do I need a Manager account to use the Google Ads API with Bolt.new?
Yes, a Google Ads Manager account (also called MCC — My Client Center) is required to apply for a developer token, which is mandatory for all Google Ads API access. Individual advertiser accounts cannot apply for a developer token directly. If you only have a standard account, create a Manager account at ads.google.com/home/tools/manager-accounts and link your existing account to it before applying.
Can I test the Google Ads integration in Bolt's WebContainer preview?
Partially. The API route that queries Google Ads data works in the preview as long as you have a valid developer token and a pre-configured refresh token in your .env file, because those are outbound calls. However, the OAuth 2.0 authorization flow — where users connect their Google accounts — requires a deployed URL with a registered redirect URI and cannot run in Bolt's WebContainer preview.
How long does Google Ads developer token approval take?
Google's manual review process typically takes 24 to 72 hours, though some applications take longer depending on the described use case. During the approval wait, you can build and test the entire integration using a basic-access test token against Google Ads test accounts. The test token is issued immediately and supports the full API feature set within test accounts.
Why does the Google Ads API return cost values as large numbers like 15000000 instead of $15?
Google Ads represents monetary values as micros (millionths of the account currency) to avoid floating-point precision errors in financial calculations. A cost of $15.00 is stored as 15,000,000 micros. Always divide cost_micros, average_cpc, and cost_per_conversion by 1,000,000 before displaying them. Bolt-generated code usually includes this conversion, but verify the dashboard shows realistic dollar amounts rather than inflated numbers.
How does the Google Ads API differ from the Facebook Ads API in a Bolt.new integration?
Google Ads requires a developer token approval process (up to 72 hours, Manager account required) and uses GAQL as its query language — there is no equivalent approval step for Facebook Ads. Facebook Ads uses the Graph API with a standard OAuth access token. Both require OAuth 2.0 for user-level access and both need a deployed URL for OAuth callback registration, but Google's GAQL syntax is more SQL-like and expressive for complex reporting queries.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation