Skip to main content

Google Ads

Connect your Google Ads account to Yellow.ai so that your AI agent can look up your campaigns and their results during a conversation. For example, it can tell a marketer which campaigns are running, or how many clicks a campaign got last week.

The integration only reads data. It can't create, change, pause or delete anything in your Google Ads account.

What you can do​

ActionWhat it doesWhat you give it
Get campaignLooks up one campaign and returns its name, status, type, and start and end dates.Customer ID and Campaign ID
Get all campaignsLists the campaigns in the account, with each campaign's ID, name and status. Removed campaigns are left out.Customer ID
Search with GAQLRuns a report that you describe in a short query, for example the clicks and cost of each campaign in the last 7 days.Customer ID and a GAQL query

How setup works​

You set this up once, and it takes about 20 minutes. There are three parts:

  1. In Google Cloud: create an app that lets Yellow.ai read your Google Ads data, and copy its Client ID and Client secret.
  2. In Yellow.ai: paste those two values and sign in with Google.
  3. In your flows: add the Google Ads actions where you need them.

Before you begin​

Make sure you have the following:

  1. A Google account that can open your Google Ads account directly, with Read only access or higher. If you reach the account only through a manager account, ask a Google Ads admin to add you to the account itself. Admins do this in Google Ads, in Admin > Access and security.
  2. Access to Google Cloud console, with permission to create a project. If your company restricts Google Cloud, ask your IT team for help.
  3. Your Google Ads customer ID. Sign in to Google Ads and click your profile picture in the top right corner. Your 10-digit customer ID is shown under your account name, for example 123-456-7890.
  4. Yellow.ai open in another browser tab.
tip

Whenever Yellow.ai asks for a Customer ID, type the 10 digits without the dashes: 1234567890, not 123-456-7890.

Part 1: Set up Google Cloud​

Yellow.ai connects to Google Ads through an app that you create in your own Google Cloud project. Google calls this app an OAuth client. Because the app is in your own project, you stay in control. You can see it, change it, or turn off Yellow.ai's access at any time.

Google also decides how much each project can do with Google Ads. This is called the project's access level. New projects start with Test access, which only works with Google Ads test accounts. In Step 3, you ask Google for Explorer access, so that you can use your real Google Ads account.

note

You don't need a Google Ads developer token. Google retired developer tokens on 9 September 2026. Older guides may still ask for one, but Google now uses your project's access level instead.

Step 1: Create a Google Cloud project​

You can also use a Google Cloud project that you already manage. In that case, select it and go to Step 2.

  1. Go to Google Cloud console and sign in.
  2. Click the project picker at the top of the page, and then click New project.
  3. In Project name, enter a name you'll recognize later, for example Yellow.ai Google Ads, and click Create.
  4. Make sure your new project is selected in the project picker before you continue.

Step 2: Turn on the Google Ads API​

  1. Open the Google Ads API page in Google Cloud console. Check that your project is selected at the top of the page.
  2. Click Enable.

Your project now has Test access.

Step 3: Get Explorer access​

  1. Open the Google Ads API Overview page for your project.
  2. Check that your current access level is Test.
  3. Expand Upgrade access level.
  4. Check that Next access level shows Explorer.
  5. Click Apply for access, and complete the application.

In most cases, Google reviews the application automatically and upgrades your project to Explorer within minutes. Open the Google Ads API Overview page again to check that your access level now shows Explorer.

Here's what each access level allows. Each time a Google Ads action runs in your flow, it uses one request.

Access levelWorks withRequests per dayHow to get it
TestGoogle Ads test accounts only. Test accounts don't run real ads.15,000Given automatically in Step 2
ExplorerYour real Google Ads accounts2,880Apply in this step. This is enough for most teams.
BasicYour real Google Ads accounts15,000Apply on the same page once you have Explorer. Your project needs Google's brand verification first.
StandardYour real Google Ads accountsNo daily limitApply on the same page once you have Basic. Google reviews it by hand, usually in about 10 business days.
If Google rejects your application

Google has a known issue that rejects Explorer and Basic applications from projects that are on the Google Cloud Free Trial, or whose billing account is suspended or disabled. If this happens, upgrade the project's billing to a paid account and apply again, or apply from a different project.

The consent screen is the page Google shows when you connect Yellow.ai. It tells you which app is asking for access.

  1. In Google Cloud console, open the menu and go to Google Auth Platform > Branding. If you see Get started, click it.

  2. In App Information, enter an App name, for example Yellow.ai. Choose your User support email, and click Next.

  3. In Audience, choose who can connect, and click Next:

    ChoiceWhat it meansWhen to choose it
    InternalOnly people in your company's Google Workspace can connect. There's no 7-day limit and no "unverified app" warning.Choose this if it's offered. Google offers it only when your project belongs to your company's Google Workspace organization. The Google account that connects must be in that organization too.
    ExternalAnyone with a Google account can connect, once you publish the app in step 6.Choose this if Internal isn't offered, for example when you use a personal Gmail account.
  4. In Contact Information, enter your email address, and click Next.

  5. In Finish, select the checkbox to agree to the Google API Services: User Data Policy, click Continue, and then click Create.

  6. If you chose External: go to Google Auth Platform > Audience, click Publish app, and confirm. The publishing status changes to In production.

caution

Don't skip step 6 if you chose External. While the app's publishing status is Testing, Google ends the connection after 7 days. The Google Ads actions in your flows then stop working until someone connects again.

You don't have to submit the app to Google for verification. Google shows a warning screen for apps it hasn't verified, and Part 2 explains what to click.

Step 5: Create the OAuth client​

  1. In Yellow.ai, go to Extensions > Integrations, and open Marketing > Google Ads. In the Instructions, find Authorized redirect URI and click the copy icon next to it.

    The redirect URI looks similar to https://cloud.yellow.ai/integration/oauth/google-ads. It's different for each Yellow.ai region, so always copy it from Yellow.ai instead of typing it.

  2. In Google Cloud console, go to Google Auth Platform > Clients, and click Create client.

  3. In Application type, choose Web application.

  4. In Name, enter a name you'll recognize, for example Yellow.ai. This name only appears in Google Cloud console.

  5. Under Authorized redirect URIs, click Add URI, and paste the redirect URI that you copied from Yellow.ai.

  6. Click Create.

  7. Google shows the new client's Client ID and Client secret. Copy both, and keep them somewhere safe.

caution

Google shows the Client secret only once, when you create the client. If you lose it, open the client in Google Auth Platform > Clients, click Add secret to create a new one, and use the new secret in Yellow.ai.

Treat the Client secret like a password. Don't share it by email or in chat.

Part 2: Connect Google Ads to Yellow.ai​

  1. In Yellow.ai, go to Extensions > Integrations, and open Marketing > Google Ads. You can also use the search box to find it.

  2. In Account name, enter a unique name for this connection, for example marketing-team. Choose a name that tells your team what it's for, because you pick this name in your flows.

  3. Paste the Client ID from Google into Client ID, and the Client secret into Client Secret.

  4. Click Connect. A Google sign-in window opens.

  5. Choose the Google account that can open your Google Ads account.

  6. If Google shows Google hasn't verified this app, click Advanced, and then click Go to Yellow.ai (unsafe). Google shows the app name that you entered in Step 4. This screen is expected, because the app is the one you created in Part 1 and Google hasn't verified it.

  7. Google asks you to allow access to your Google Ads data. Click Continue or Allow.

    Google describes this access as viewing and changing your Google Ads data, because Google Ads uses one permission for both. The Yellow.ai Google Ads actions only read data.

  8. The window closes, and the account shows as connected in Yellow.ai.

One connection works with every Google Ads account that the signed-in Google account can open. You choose which Google Ads account to use in each action, with the Customer ID.

To connect another Google account, click Add account and repeat steps 2 to 8 with a different account name.

note
  1. In a two-tier environment, such as AI agents with only Development and Live environments, you can add accounts only in Development. In Live, you can choose the accounts but not edit them.
  2. In a three-tier environment, such as AI agents with Staging, Sandbox and Production environments, you can add and edit accounts in Staging and Sandbox. In Production, only the accounts added in Staging are available, and you can only choose them.

Part 3: Use Google Ads in a flow​

Add a Google Ads action​

  1. Go to Automation, and open the flow where you need Google Ads data, or create a flow.
  2. Create a variable with the data type Object to hold the result. For example, name it campaign_details.
  3. At the point in the flow where you need the data, drag the node connector, and choose Integrations > Google Ads.
  4. Fill in the node:
    • Account name: the account you connected in Part 2.
    • Action: Get campaign, Get all campaigns or Search with GAQL.
    • The action's fields, which are described below. Type a value, or select a variable to use a value from the conversation.
  5. Choose the variable from step 2 to store the response.
  6. To see what the action returns, click Show sample response.

Then show the data in a message.

Get campaign​

FieldWhat to enter
Customer IDYour 10-digit Google Ads customer ID, without the dashes. For example, 1234567890.
Campaign IDThe ID of the campaign. To find a campaign's ID, use Get all campaigns.

Example response:

{
"results": [
{
"campaign": {
"resourceName": "customers/1234567890/campaigns/123",
"id": "123",
"name": "Spring Sale",
"status": "ENABLED",
"primaryStatus": "ELIGIBLE",
"advertisingChannelType": "SEARCH",
"startDateTime": "2026-01-15 00:00:00",
"endDateTime": "2026-12-31 23:59:59"
}
}
],
"fieldMask": "campaign.id,campaign.name,campaign.status,campaign.primaryStatus,campaign.advertisingChannelType,campaign.startDateTime,campaign.endDateTime"
}

What the values mean:

ValueMeaning
nameThe campaign's name.
statusWhat the campaign is set to: ENABLED (switched on), PAUSED or REMOVED.
primaryStatusWhether the campaign can actually run right now. For example, ELIGIBLE (can run), LIMITED (running with limits, such as a low budget), PAUSED, PENDING (hasn't started yet) or ENDED.
advertisingChannelTypeThe campaign type, for example SEARCH, DISPLAY, VIDEO, SHOPPING or PERFORMANCE_MAX.
startDateTime, endDateTimeWhen the campaign starts and ends, in your Google Ads account's time zone.

If no campaign in that account has the ID you entered, the response has no results list.

Get all campaigns​

FieldWhat to enter
Customer IDYour 10-digit Google Ads customer ID, without the dashes.

The campaigns are sorted by name. Example response:

{
"results": [
{
"campaign": {
"resourceName": "customers/1234567890/campaigns/123",
"id": "123",
"name": "Spring Sale",
"status": "ENABLED"
}
},
{
"campaign": {
"resourceName": "customers/1234567890/campaigns/456",
"id": "456",
"name": "Summer Launch",
"status": "PAUSED"
}
}
],
"fieldMask": "campaign.id,campaign.name,campaign.status"
}

Search with GAQL​

GAQL (Google Ads Query Language) is how you ask Google Ads for a report. A query has three parts:

  • SELECT: the information you want, for example the campaign name and its clicks.
  • FROM: what each row is about, usually campaign.
  • WHERE: filters, such as a date range or only campaigns that are switched on. This part is optional.
FieldWhat to enter
Customer IDYour 10-digit Google Ads customer ID, without the dashes.
GAQL QueryThe query. You can copy one of the examples below.

Impressions, clicks and cost of each campaign in the last 7 days:

SELECT campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros FROM campaign WHERE segments.date DURING LAST_7_DAYS AND campaign.status != 'REMOVED'

Results of one campaign this month. Replace 123 with the campaign's ID.

SELECT campaign.name, metrics.impressions, metrics.clicks, metrics.conversions, metrics.cost_micros FROM campaign WHERE campaign.id = 123 AND segments.date DURING THIS_MONTH

Campaigns that are switched on:

SELECT campaign.id, campaign.name FROM campaign WHERE campaign.status = 'ENABLED'

To change the period, replace the word after DURING with one of these:

WriteTo get
TODAYToday only
YESTERDAYYesterday only
LAST_7_DAYSThe last 7 days, not including today
LAST_30_DAYSThe last 30 days, not including today
THIS_MONTHAll days in the current month
LAST_MONTHAll days in the previous month

Example response for the first query:

{
"results": [
{
"campaign": {
"resourceName": "customers/1234567890/campaigns/123",
"name": "Spring Sale"
},
"metrics": {
"impressions": "5120",
"clicks": "230",
"costMicros": "41500000"
}
}
],
"fieldMask": "campaign.name,metrics.impressions,metrics.clicks,metrics.costMicros"
}

How to read the response:

  • Names are written differently in the response. The underscore is removed and the next letter becomes a capital, so cost_micros in the query becomes costMicros in the response.
  • Counts are returned as text, for example "230" instead of 230.
  • cost_micros is the cost in millionths of your account's currency. Divide it by 1,000,000. For example, 41500000 means 41.50.
tip

Google's Interactive GAQL query builder helps you choose fields and checks your query before you use it in Yellow.ai.

Show the data in a message​

To show the result to the user, use the variable in a message node. Replace campaign_details with your variable's name.

To showWrite
The campaign's name (Get campaign){{{variables.campaign_details.results.0.campaign.name}}}
Whether it can run (Get campaign){{{variables.campaign_details.results.0.campaign.primaryStatus}}}
The second campaign's name (Get all campaigns){{{variables.campaign_details.results.1.campaign.name}}}
The clicks in the first row (Search with GAQL){{{variables.campaign_details.results.0.metrics.clicks}}}

In these examples, results.0 is the first item in the list, results.1 is the second, and so on.

If something doesn't work​

When you connect​

What you seeWhat it meansWhat to do
Error 400: redirect_uri_mismatch in the Google windowThe redirect URI in your Google client doesn't exactly match the one in Yellow.ai, or Google hasn't applied it yet.Copy the Authorized redirect URI from Yellow.ai again, and paste it into your client's Authorized redirect URIs. Google can take from 5 minutes to a few hours to apply a change, so wait a little before you try again.
Error 401: invalid_client in the Google windowThe Client ID is wrong.Copy the Client ID from Google Auth Platform > Clients again, and paste it into Yellow.ai.
Access blocked and Error 403: access_denied in the Google windowThe app's audience is External, and its publishing status is still Testing.In Google Auth Platform > Audience, click Publish app. Then connect again.
Error 403: org_internal in the Google windowThe app's audience is Internal, and you signed in with a Google account from outside your organization.Sign in with an account from your organization. Or change the audience to External, and publish the app.
Google hasn't verified this appThis is expected for an External app that you created yourself.Click Advanced, and then click Go to Yellow.ai (unsafe).
Yellow.ai shows an error after you sign inThe Client Secret is wrong.Paste the Client secret again. If you no longer have it, create a new one with Add secret.

When an action fails​

A failed action returns a response with the same shape as the API error response sample in the node. In it, apiResponseStatusCode is the status code from Google, and apiResponseBody contains Google's explanation. Use them to find the cause:

What the error response showsWhat it meansWhat to do
403, and CLOUD_PROJECT_NOT_APPROVED_FOR_PRODUCTION in apiResponseBodyYour Google Cloud project still has Test access.Get Explorer access, and check that the Google Ads API Overview page shows Explorer.
403, and USER_PERMISSION_DENIED in apiResponseBodyThe connected Google account can't open this Google Ads account directly, or the Customer ID belongs to another account.Check the Customer ID. Then ask a Google Ads admin to add the connected Google account to this Google Ads account itself, not only to a manager account.
400The GAQL query has a mistake, or the Customer ID isn't 10 digits without dashes. apiResponseBody says which.Fix the Customer ID, or check the query in Google's Interactive GAQL query builder.
429, and RESOURCE_EXHAUSTED in apiResponseBodyYour project reached its daily limit, which is 2,880 requests with Explorer access.Wait a few hours, or apply for Basic access on the Google Ads API Overview page.
Token Generation/Refresh failed in errorThe connection has stopped working. This happens when access is removed from the Google account, when the app stayed in Testing for more than 7 days, or when the connection wasn't used for 6 months.Make sure the app is published (see Step 4). Then, in Yellow.ai, click Disconnect on the account, click Add account, and connect again with the same account name, so your flows keep working.

If Get campaign succeeds but the response has no results list, no campaign with that ID exists in that Google Ads account. Check the Customer ID and the Campaign ID, and use Get all campaigns to see the right IDs.

References​

  1. Access levels and permissible use (Google Ads API)
  2. Developer token sunset and the new sign-up (Google Ads API)
  3. Manage OAuth clients (Google Cloud Help)
  4. Manage app audience (Google Cloud Help)
  5. Refresh token expiration (Google Identity)
  6. Find your Google Ads customer ID (Google Ads Help)
  7. Google Ads Query Language overview (Google Ads API)
  8. Date ranges in GAQL (Google Ads API)
  9. Campaign fields you can query (Google Ads API)