Skip to content

Commit 093cfac

Browse files
committed
feat(google-ads): add google ads integration for campaign and ad performance queries
1 parent 4ccb573 commit 093cfac

File tree

20 files changed

+1677
-0
lines changed

20 files changed

+1677
-0
lines changed

apps/docs/components/icons.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,6 +3464,27 @@ export const ResendIcon = (props: SVGProps<SVGSVGElement>) => (
34643464
</svg>
34653465
)
34663466

3467+
export const GoogleAdsIcon = (props: SVGProps<SVGSVGElement>) => (
3468+
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>
3469+
<g transform='matrix(.257748 0 0 .257745 -.361416 2.515516)'>
3470+
<path
3471+
d='M85.9 28.6c2.4-6.3 5.7-12.1 10.6-16.8 19.6-19.1 52-14.3 65.3 9.7 10 18.2 20.6 36 30.9 54l51.6 89.8c14.3 25.1-1.2 56.8-29.6 61.1-17.4 2.6-33.7-5.4-42.7-21l-45.4-78.8c-.3-.6-.7-1.1-1.1-1.6-1.6-1.3-2.3-3.2-3.3-4.9L88.8 62.2c-3.9-6.8-5.7-14.2-5.5-22 .3-4 .8-8 2.6-11.6'
3472+
fill='#3c8bd9'
3473+
/>
3474+
<path
3475+
d='M85.9 28.6c-.9 3.6-1.7 7.2-1.9 11-.3 8.4 1.8 16.2 6 23.5l32.9 56.9c1 1.7 1.8 3.4 2.8 5l-18.1 31.1-25.3 43.6c-.4 0-.5-.2-.6-.5-.1-.8.2-1.5.4-2.3 4.1-15 .7-28.3-9.6-39.7-6.3-6.9-14.3-10.8-23.5-12.1-12-1.7-22.6 1.4-32.1 8.9-1.7 1.3-2.8 3.2-4.8 4.2-.4 0-.6-.2-.7-.5l14.3-24.9L85.2 29.7c.2-.4.5-.7.7-1.1'
3476+
fill='#fabc04'
3477+
/>
3478+
<path
3479+
d='M11.8 158l5.7-5.1c24.3-19.2 60.8-5.3 66.1 25.1 1.3 7.3.6 14.3-1.6 21.3-.1.6-.2 1.1-.4 1.7-.9 1.6-1.7 3.3-2.7 4.9-8.9 14.7-22 22-39.2 20.9C20 225.4 4.5 210.6 1.8 191c-1.3-9.5.6-18.4 5.5-26.6 1-1.8 2.2-3.4 3.3-5.2.5-.4.3-1.2 1.2-1.2'
3480+
fill='#34a852'
3481+
/>
3482+
<path d='M11.8 158c-.4.4-.4 1.1-1.1 1.2-.1-.7.3-1.1.7-1.6l.4.4' fill='#fabc04' />
3483+
<path d='M81.6 201c-.4-.7 0-1.2.4-1.7l.4.4-.8 1.3' fill='#e1c025' />
3484+
</g>
3485+
</svg>
3486+
)
3487+
34673488
export const GoogleBigQueryIcon = (props: SVGProps<SVGSVGElement>) => (
34683489
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>
34693490
<path

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
GitLabIcon,
4444
GmailIcon,
4545
GongIcon,
46+
GoogleAdsIcon,
4647
GoogleBigQueryIcon,
4748
GoogleBooksIcon,
4849
GoogleCalendarIcon,
@@ -192,6 +193,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
192193
gitlab: GitLabIcon,
193194
gmail_v2: GmailIcon,
194195
gong: GongIcon,
196+
google_ads: GoogleAdsIcon,
195197
google_bigquery: GoogleBigQueryIcon,
196198
google_books: GoogleBooksIcon,
197199
google_calendar_v2: GoogleCalendarIcon,
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
---
2+
title: Google Ads
3+
description: Query campaigns, ad groups, and performance metrics
4+
---
5+
6+
import { BlockInfoCard } from "@/components/ui/block-info-card"
7+
8+
<BlockInfoCard
9+
type="google_ads"
10+
color="#E0E0E0"
11+
/>
12+
13+
{/* MANUAL-CONTENT-START:intro */}
14+
[Google Ads](https://ads.google.com) is Google's online advertising platform that lets businesses create ads to reach customers across Google Search, YouTube, Gmail, and millions of partner websites. It supports campaign types including Search, Display, Video, Shopping, and Performance Max, with detailed targeting, bidding strategies, and performance analytics.
15+
16+
In Sim, the Google Ads integration enables your agents to query campaign data, monitor ad group performance, and pull detailed metrics using the Google Ads Query Language (GAQL). This supports use cases such as automated performance reporting, budget monitoring, campaign health checks, and data-driven optimization workflows. By connecting Sim with Google Ads, your agents can retrieve real-time advertising data and act on insights without manual dashboard navigation.
17+
{/* MANUAL-CONTENT-END */}
18+
19+
20+
## Usage Instructions
21+
22+
Connect to Google Ads to list accessible accounts, list campaigns, view ad group details, get performance metrics, and run custom GAQL queries.
23+
24+
25+
26+
## Tools
27+
28+
### `google_ads_list_customers`
29+
30+
List all Google Ads customer accounts accessible by the authenticated user
31+
32+
#### Input
33+
34+
| Parameter | Type | Required | Description |
35+
| --------- | ---- | -------- | ----------- |
36+
| `developerToken` | string | Yes | Google Ads API developer token |
37+
38+
#### Output
39+
40+
| Parameter | Type | Description |
41+
| --------- | ---- | ----------- |
42+
| `customerIds` | array | List of accessible customer IDs |
43+
| `totalCount` | number | Total number of accessible customer accounts |
44+
45+
### `google_ads_search`
46+
47+
Run a custom Google Ads Query Language (GAQL) query
48+
49+
#### Input
50+
51+
| Parameter | Type | Required | Description |
52+
| --------- | ---- | -------- | ----------- |
53+
| `customerId` | string | Yes | Google Ads customer ID \(numeric, no dashes\) |
54+
| `developerToken` | string | Yes | Google Ads API developer token |
55+
| `managerCustomerId` | string | No | Manager account customer ID \(if accessing via manager account\) |
56+
| `query` | string | Yes | GAQL query to execute |
57+
| `pageSize` | number | No | Maximum number of results per page \(max 10000\) |
58+
| `pageToken` | string | No | Page token for pagination |
59+
60+
#### Output
61+
62+
| Parameter | Type | Description |
63+
| --------- | ---- | ----------- |
64+
| `results` | json | Array of result objects from the GAQL query |
65+
| `totalResultsCount` | number | Total number of matching results |
66+
| `nextPageToken` | string | Token for the next page of results |
67+
68+
### `google_ads_list_campaigns`
69+
70+
List campaigns in a Google Ads account with optional status filtering
71+
72+
#### Input
73+
74+
| Parameter | Type | Required | Description |
75+
| --------- | ---- | -------- | ----------- |
76+
| `customerId` | string | Yes | Google Ads customer ID \(numeric, no dashes\) |
77+
| `developerToken` | string | Yes | Google Ads API developer token |
78+
| `managerCustomerId` | string | No | Manager account customer ID \(if accessing via manager account\) |
79+
| `status` | string | No | Filter by campaign status \(ENABLED, PAUSED, REMOVED\) |
80+
| `limit` | number | No | Maximum number of campaigns to return |
81+
82+
#### Output
83+
84+
| Parameter | Type | Description |
85+
| --------- | ---- | ----------- |
86+
| `campaigns` | array | List of campaigns in the account |
87+
|`id` | string | Campaign ID |
88+
|`name` | string | Campaign name |
89+
|`status` | string | Campaign status \(ENABLED, PAUSED, REMOVED\) |
90+
|`channelType` | string | Advertising channel type \(SEARCH, DISPLAY, SHOPPING, VIDEO, PERFORMANCE_MAX\) |
91+
|`startDate` | string | Campaign start date \(YYYY-MM-DD\) |
92+
|`endDate` | string | Campaign end date \(YYYY-MM-DD\) |
93+
|`budgetAmountMicros` | string | Daily budget in micros \(divide by 1,000,000 for currency value\) |
94+
| `totalCount` | number | Total number of campaigns returned |
95+
96+
### `google_ads_campaign_performance`
97+
98+
Get performance metrics for Google Ads campaigns over a date range
99+
100+
#### Input
101+
102+
| Parameter | Type | Required | Description |
103+
| --------- | ---- | -------- | ----------- |
104+
| `customerId` | string | Yes | Google Ads customer ID \(numeric, no dashes\) |
105+
| `developerToken` | string | Yes | Google Ads API developer token |
106+
| `managerCustomerId` | string | No | Manager account customer ID \(if accessing via manager account\) |
107+
| `campaignId` | string | No | Filter by specific campaign ID |
108+
| `dateRange` | string | No | Predefined date range \(LAST_7_DAYS, LAST_30_DAYS, THIS_MONTH, LAST_MONTH, TODAY, YESTERDAY\) |
109+
| `startDate` | string | No | Custom start date in YYYY-MM-DD format |
110+
| `endDate` | string | No | Custom end date in YYYY-MM-DD format |
111+
112+
#### Output
113+
114+
| Parameter | Type | Description |
115+
| --------- | ---- | ----------- |
116+
| `campaigns` | array | Campaign performance data broken down by date |
117+
|`id` | string | Campaign ID |
118+
|`name` | string | Campaign name |
119+
|`status` | string | Campaign status |
120+
|`impressions` | string | Number of impressions |
121+
|`clicks` | string | Number of clicks |
122+
|`costMicros` | string | Cost in micros \(divide by 1,000,000 for currency value\) |
123+
|`ctr` | number | Click-through rate \(0.0 to 1.0\) |
124+
|`conversions` | number | Number of conversions |
125+
|`date` | string | Date for this row \(YYYY-MM-DD\) |
126+
| `totalCount` | number | Total number of result rows |
127+
128+
### `google_ads_list_ad_groups`
129+
130+
List ad groups in a Google Ads campaign
131+
132+
#### Input
133+
134+
| Parameter | Type | Required | Description |
135+
| --------- | ---- | -------- | ----------- |
136+
| `customerId` | string | Yes | Google Ads customer ID \(numeric, no dashes\) |
137+
| `developerToken` | string | Yes | Google Ads API developer token |
138+
| `managerCustomerId` | string | No | Manager account customer ID \(if accessing via manager account\) |
139+
| `campaignId` | string | Yes | Campaign ID to list ad groups for |
140+
| `status` | string | No | Filter by ad group status \(ENABLED, PAUSED, REMOVED\) |
141+
| `limit` | number | No | Maximum number of ad groups to return |
142+
143+
#### Output
144+
145+
| Parameter | Type | Description |
146+
| --------- | ---- | ----------- |
147+
| `adGroups` | array | List of ad groups in the campaign |
148+
|`id` | string | Ad group ID |
149+
|`name` | string | Ad group name |
150+
|`status` | string | Ad group status \(ENABLED, PAUSED, REMOVED\) |
151+
|`type` | string | Ad group type \(SEARCH_STANDARD, DISPLAY_STANDARD, SHOPPING_PRODUCT_ADS\) |
152+
|`campaignId` | string | Parent campaign ID |
153+
|`campaignName` | string | Parent campaign name |
154+
| `totalCount` | number | Total number of ad groups returned |
155+
156+
### `google_ads_ad_performance`
157+
158+
Get performance metrics for individual ads over a date range
159+
160+
#### Input
161+
162+
| Parameter | Type | Required | Description |
163+
| --------- | ---- | -------- | ----------- |
164+
| `customerId` | string | Yes | Google Ads customer ID \(numeric, no dashes\) |
165+
| `developerToken` | string | Yes | Google Ads API developer token |
166+
| `managerCustomerId` | string | No | Manager account customer ID \(if accessing via manager account\) |
167+
| `campaignId` | string | No | Filter by campaign ID |
168+
| `adGroupId` | string | No | Filter by ad group ID |
169+
| `dateRange` | string | No | Predefined date range \(LAST_7_DAYS, LAST_30_DAYS, THIS_MONTH, LAST_MONTH, TODAY, YESTERDAY\) |
170+
| `startDate` | string | No | Custom start date in YYYY-MM-DD format |
171+
| `endDate` | string | No | Custom end date in YYYY-MM-DD format |
172+
| `limit` | number | No | Maximum number of results to return |
173+
174+
#### Output
175+
176+
| Parameter | Type | Description |
177+
| --------- | ---- | ----------- |
178+
| `ads` | array | Ad performance data broken down by date |
179+
|`adId` | string | Ad ID |
180+
|`adGroupId` | string | Parent ad group ID |
181+
|`adGroupName` | string | Parent ad group name |
182+
|`campaignId` | string | Parent campaign ID |
183+
|`campaignName` | string | Parent campaign name |
184+
|`adType` | string | Ad type \(RESPONSIVE_SEARCH_AD, EXPANDED_TEXT_AD, etc.\) |
185+
|`impressions` | string | Number of impressions |
186+
|`clicks` | string | Number of clicks |
187+
|`costMicros` | string | Cost in micros \(divide by 1,000,000 for currency value\) |
188+
|`ctr` | number | Click-through rate \(0.0 to 1.0\) |
189+
|`conversions` | number | Number of conversions |
190+
|`date` | string | Date for this row \(YYYY-MM-DD\) |
191+
| `totalCount` | number | Total number of result rows |
192+
193+

apps/docs/content/docs/en/tools/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"gitlab",
3939
"gmail",
4040
"gong",
41+
"google_ads",
4142
"google_bigquery",
4243
"google_books",
4344
"google_calendar",

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const SCOPE_DESCRIPTIONS: Record<string, string> = {
4545
'https://www.googleapis.com/auth/userinfo.profile': 'View basic profile info',
4646
'https://www.googleapis.com/auth/forms.body': 'View and manage Google Forms',
4747
'https://www.googleapis.com/auth/forms.responses.readonly': 'View responses to Google Forms',
48+
'https://www.googleapis.com/auth/adwords': 'Manage Google Ads campaigns and reporting',
4849
'https://www.googleapis.com/auth/bigquery': 'View and manage data in Google BigQuery',
4950
'https://www.googleapis.com/auth/ediscovery': 'Access Google Vault for eDiscovery',
5051
'https://www.googleapis.com/auth/devstorage.read_only': 'Read files from Google Cloud Storage',

0 commit comments

Comments
 (0)