Skip to content

Commit 83f3be8

Browse files
committed
feat(google-analytics): add Google Analytics GA4 integration
1 parent 952915a commit 83f3be8

27 files changed

+1264
-24
lines changed

apps/docs/components/icons.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,6 +3600,25 @@ export const ResendIcon = (props: SVGProps<SVGSVGElement>) => (
36003600
</svg>
36013601
)
36023602

3603+
export const GoogleAnalyticsIcon = (props: SVGProps<SVGSVGElement>) => (
3604+
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>
3605+
<g transform='translate(-174.95 -339.18)scale(3.54856)'>
3606+
<path
3607+
d='M149.3 112.8V221c0 12.1 8.4 18.9 17.2 18.9 8.2 0 17.2-5.7 17.2-18.9V113.6c0-11.1-8.2-18-17.2-18s-17.2 7.6-17.2 17.2'
3608+
fill='#f8ab00'
3609+
/>
3610+
<path
3611+
d='M104.2 167.7V221c0 12.1 8.4 18.9 17.2 18.9 8.2 0 17.2-5.7 17.2-18.9v-52.5c0-11.1-8.2-18-17.2-18s-17.2 7.7-17.2 17.2'
3612+
fill='#e37300'
3613+
/>
3614+
<path
3615+
d='M93.6 222.7c0 9.5-7.7 17.2-17.2 17.2s-17.2-7.7-17.2-17.2 7.7-17.2 17.2-17.2 17.2 7.6 17.2 17.2'
3616+
fill='#e37300'
3617+
/>
3618+
</g>
3619+
</svg>
3620+
)
3621+
36033622
export const GoogleAdsIcon = (props: SVGProps<SVGSVGElement>) => (
36043623
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>
36053624
<g transform='matrix(.257748 0 0 .257745 -.361416 2.515516)'>

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ import {
4747
FirecrawlIcon,
4848
FirefliesIcon,
4949
GammaIcon,
50-
GithubIcon,
5150
GitLabIcon,
51+
GithubIcon,
5252
GmailIcon,
5353
GongIcon,
5454
GoogleAdsIcon,
55+
GoogleAnalyticsIcon,
5556
GoogleBigQueryIcon,
5657
GoogleBooksIcon,
5758
GoogleCalendarIcon,
@@ -91,9 +92,9 @@ import {
9192
LinkupIcon,
9293
LoopsIcon,
9394
LumaIcon,
95+
MailServerIcon,
9496
MailchimpIcon,
9597
MailgunIcon,
96-
MailServerIcon,
9798
Mem0Icon,
9899
MicrosoftDataverseIcon,
99100
MicrosoftExcelIcon,
@@ -128,6 +129,8 @@ import {
128129
ResendIcon,
129130
RevenueCatIcon,
130131
S3Icon,
132+
SQSIcon,
133+
STTIcon,
131134
SalesforceIcon,
132135
SearchIcon,
133136
SendgridIcon,
@@ -139,19 +142,17 @@ import {
139142
SimilarwebIcon,
140143
SlackIcon,
141144
SmtpIcon,
142-
SQSIcon,
143145
SshIcon,
144-
STTIcon,
145146
StagehandIcon,
146147
StripeIcon,
147148
SupabaseIcon,
149+
TTSIcon,
148150
TavilyIcon,
149151
TelegramIcon,
150152
TextractIcon,
151153
TinybirdIcon,
152154
TranslateIcon,
153155
TrelloIcon,
154-
TTSIcon,
155156
TwilioIcon,
156157
TypeformIcon,
157158
UpstashIcon,
@@ -162,11 +163,11 @@ import {
162163
WhatsAppIcon,
163164
WikipediaIcon,
164165
WordpressIcon,
165-
xIcon,
166166
YouTubeIcon,
167167
ZendeskIcon,
168168
ZepIcon,
169169
ZoomIcon,
170+
xIcon,
170171
} from '@/components/icons'
171172

172173
type IconComponent = ComponentType<SVGProps<SVGSVGElement>>
@@ -218,6 +219,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
218219
gmail_v2: GmailIcon,
219220
gong: GongIcon,
220221
google_ads: GoogleAdsIcon,
222+
google_analytics: GoogleAnalyticsIcon,
221223
google_bigquery: GoogleBigQueryIcon,
222224
google_books: GoogleBooksIcon,
223225
google_calendar_v2: GoogleCalendarIcon,

apps/docs/content/docs/en/tools/firecrawl.mdx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Extract structured content from web pages with comprehensive metadata support. C
5353
| `url` | string | Yes | The URL to scrape content from \(e.g., "https://example.com/page"\) |
5454
| `scrapeOptions` | json | No | Options for content scraping |
5555
| `apiKey` | string | Yes | Firecrawl API key |
56+
| `pricing` | custom | No | No description |
57+
| `metadata` | string | No | No description |
58+
| `rateLimit` | string | No | No description |
5659

5760
#### Output
5861

@@ -86,6 +89,9 @@ Search for information on the web using Firecrawl
8689
| --------- | ---- | -------- | ----------- |
8790
| `query` | string | Yes | The search query to use |
8891
| `apiKey` | string | Yes | Firecrawl API key |
92+
| `pricing` | custom | No | No description |
93+
| `metadata` | string | No | No description |
94+
| `rateLimit` | string | No | No description |
8995

9096
#### Output
9197

@@ -123,6 +129,9 @@ Crawl entire websites and extract structured content from all accessible pages
123129
| `includePaths` | json | No | URL paths to include in crawling \(e.g., \["/docs/*", "/api/*"\]\). Only these paths will be crawled |
124130
| `onlyMainContent` | boolean | No | Extract only main content from pages |
125131
| `apiKey` | string | Yes | Firecrawl API Key |
132+
| `pricing` | custom | No | No description |
133+
| `metadata` | string | No | No description |
134+
| `rateLimit` | string | No | No description |
126135

127136
#### Output
128137

@@ -142,7 +151,6 @@ Crawl entire websites and extract structured content from all accessible pages
142151
|`statusCode` | number | HTTP status code |
143152
|`ogLocaleAlternate` | array | Alternate locale versions |
144153
| `total` | number | Total number of pages found during crawl |
145-
| `creditsUsed` | number | Number of credits consumed by the crawl operation |
146154

147155
### `firecrawl_map`
148156

@@ -161,6 +169,9 @@ Get a complete list of URLs from any website quickly and reliably. Useful for di
161169
| `timeout` | number | No | Request timeout in milliseconds |
162170
| `location` | json | No | Geographic context for proxying \(country, languages\) |
163171
| `apiKey` | string | Yes | Firecrawl API key |
172+
| `pricing` | custom | No | No description |
173+
| `metadata` | string | No | No description |
174+
| `rateLimit` | string | No | No description |
164175

165176
#### Output
166177

@@ -187,6 +198,9 @@ Extract structured data from entire webpages using natural language prompts and
187198
| `ignoreInvalidURLs` | boolean | No | Skip invalid URLs in the array \(default: true\) |
188199
| `scrapeOptions` | json | No | Advanced scraping configuration options |
189200
| `apiKey` | string | Yes | Firecrawl API key |
201+
| `pricing` | custom | No | No description |
202+
| `metadata` | string | No | No description |
203+
| `rateLimit` | string | No | No description |
190204

191205
#### Output
192206

@@ -217,7 +231,6 @@ Autonomous web data extraction agent. Searches and gathers information based on
217231
| `success` | boolean | Whether the agent operation was successful |
218232
| `status` | string | Current status of the agent job \(processing, completed, failed\) |
219233
| `data` | object | Extracted data from the agent |
220-
| `creditsUsed` | number | Number of credits consumed by this agent task |
221234
| `expiresAt` | string | Timestamp when the results expire \(24 hours\) |
222235
| `sources` | object | Array of source URLs used by the agent |
223236

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: Google Analytics
3+
description: Query GA4 analytics data and reports
4+
---
5+
6+
import { BlockInfoCard } from "@/components/ui/block-info-card"
7+
8+
<BlockInfoCard
9+
type="google_analytics"
10+
color="#E0E0E0"
11+
/>
12+
13+
{/* MANUAL-CONTENT-START:intro */}
14+
[Google Analytics](https://analytics.google.com) is Google's web and app analytics platform. Through Sim, your agents can query GA4 property data to automate reporting, monitoring, and analysis workflows.
15+
16+
**The following Google Analytics Data API operations are included in this integration:**
17+
18+
- **Run Report:** Generate customized reports with dimensions, metrics, date ranges, filters, and sorting. Supports pagination for large datasets.
19+
- **Run Realtime Report:** Get live data from the last 30 minutes, including active users, page views, and conversions in real time.
20+
- **Get Metadata:** Discover all available dimensions and metrics for a GA4 property, including their descriptions and categories.
21+
22+
With these operations, your Sim agents can automate daily/weekly analytics reporting, monitor real-time traffic and conversions, build dashboards from GA4 data, detect anomalies in key metrics, and enrich workflows with analytics context—all without manual work in the Google Analytics UI.
23+
{/* MANUAL-CONTENT-END */}
24+
25+
26+
## Usage Instructions
27+
28+
Integrate Google Analytics GA4 into your workflow. Run custom reports, get realtime data, and discover available dimensions and metrics.
29+
30+
31+
32+
## Tools
33+
34+
### `google_analytics_run_report`
35+
36+
Run a customized report on Google Analytics GA4 property data
37+
38+
#### Input
39+
40+
| Parameter | Type | Required | Description |
41+
| --------- | ---- | -------- | ----------- |
42+
| `propertyId` | string | Yes | The GA4 property ID \(e.g., 123456789\) |
43+
| `dimensions` | string | Yes | Comma-separated dimension names \(e.g., date,country,deviceCategory\). See GA4 dimensions reference. |
44+
| `metrics` | string | Yes | Comma-separated metric names \(e.g., activeUsers,sessions,screenPageViews\). See GA4 metrics reference. |
45+
| `startDate` | string | Yes | Start date in YYYY-MM-DD format, or relative dates like "7daysAgo", "30daysAgo", "yesterday" |
46+
| `endDate` | string | Yes | End date in YYYY-MM-DD format, or "today", "yesterday" |
47+
| `dimensionFilter` | string | No | Dimension filter as JSON \(e.g., \{"filter":\{"fieldName":"country","stringFilter":\{"value":"US"\}\}\}\) |
48+
| `metricFilter` | string | No | Metric filter as JSON \(e.g., \{"filter":\{"fieldName":"activeUsers","numericFilter":\{"operation":"GREATER_THAN","value":\{"int64Value":"100"\}\}\}\}\) |
49+
| `orderBys` | string | No | Order by specification as JSON array \(e.g., \[\{"metric":\{"metricName":"activeUsers"\},"desc":true\}\]\) |
50+
| `limit` | number | No | Maximum number of rows to return \(default: 10000, max: 250000\) |
51+
| `offset` | number | No | Starting row offset for pagination \(default: 0\) |
52+
| `keepEmptyRows` | boolean | No | Whether to include rows with all zero metric values |
53+
| `currencyCode` | string | No | Currency code for revenue metrics \(e.g., USD, EUR\) |
54+
55+
#### Output
56+
57+
| Parameter | Type | Description |
58+
| --------- | ---- | ----------- |
59+
| `dimensionHeaders` | array | Dimension column headers |
60+
|`name` | string | Dimension name |
61+
| `metricHeaders` | array | Metric column headers |
62+
|`name` | string | Metric name |
63+
|`type` | string | Metric data type |
64+
| `rows` | array | Report data rows |
65+
|`dimensionValues` | json | Array of dimension values for this row |
66+
|`metricValues` | json | Array of metric values for this row |
67+
| `rowCount` | number | Total number of rows in the result |
68+
| `metadata` | json | Report metadata including currency code and time zone |
69+
|`currencyCode` | string | Currency code used in the report |
70+
|`timeZone` | string | Time zone used in the report |
71+
72+
### `google_analytics_run_realtime_report`
73+
74+
Run a realtime report on Google Analytics GA4 property data from the last 30 minutes
75+
76+
#### Input
77+
78+
| Parameter | Type | Required | Description |
79+
| --------- | ---- | -------- | ----------- |
80+
| `propertyId` | string | Yes | The GA4 property ID \(e.g., 123456789\) |
81+
| `dimensions` | string | No | Comma-separated dimension names for realtime data \(e.g., unifiedScreenName,country,deviceCategory\) |
82+
| `metrics` | string | Yes | Comma-separated metric names \(e.g., activeUsers,screenPageViews,conversions\) |
83+
| `dimensionFilter` | string | No | Dimension filter as JSON |
84+
| `metricFilter` | string | No | Metric filter as JSON |
85+
| `limit` | number | No | Maximum number of rows to return \(default: 10000, max: 250000\) |
86+
| `startMinutesAgo` | number | No | Start of the time window in minutes ago \(default: 29, max: 29 for standard, 59 for 360\) |
87+
| `endMinutesAgo` | number | No | End of the time window in minutes ago \(default: 0, meaning now\) |
88+
89+
#### Output
90+
91+
| Parameter | Type | Description |
92+
| --------- | ---- | ----------- |
93+
| `dimensionHeaders` | array | Dimension column headers |
94+
|`name` | string | Dimension name |
95+
| `metricHeaders` | array | Metric column headers |
96+
|`name` | string | Metric name |
97+
|`type` | string | Metric data type |
98+
| `rows` | array | Realtime report data rows |
99+
|`dimensionValues` | json | Array of dimension values for this row |
100+
|`metricValues` | json | Array of metric values for this row |
101+
| `rowCount` | number | Total number of rows in the result |
102+
103+
### `google_analytics_get_metadata`
104+
105+
Get available dimensions, metrics, and their descriptions for a Google Analytics GA4 property
106+
107+
#### Input
108+
109+
| Parameter | Type | Required | Description |
110+
| --------- | ---- | -------- | ----------- |
111+
| `propertyId` | string | Yes | The GA4 property ID \(e.g., 123456789\). Use 0 to get universal metadata available across all properties. |
112+
113+
#### Output
114+
115+
| Parameter | Type | Description |
116+
| --------- | ---- | ----------- |
117+
| `dimensions` | array | Available dimensions for the property |
118+
|`apiName` | string | API name to use in report requests |
119+
|`uiName` | string | Human-readable display name |
120+
|`description` | string | Description of the dimension |
121+
|`category` | string | Category grouping |
122+
| `metrics` | array | Available metrics for the property |
123+
|`apiName` | string | API name to use in report requests |
124+
|`uiName` | string | Human-readable display name |
125+
|`description` | string | Description of the metric |
126+
|`category` | string | Category grouping |
127+
|`type` | string | Data type of the metric |
128+
129+

apps/docs/content/docs/en/tools/google_books.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Search for books using the Google Books API
4646
| `startIndex` | number | No | Index of the first result to return \(for pagination\) |
4747
| `maxResults` | number | No | Maximum number of results to return \(1-40\) |
4848
| `langRestrict` | string | No | Restrict results to a specific language \(ISO 639-1 code\) |
49+
| `pricing` | per_request | No | No description |
50+
| `rateLimit` | string | No | No description |
4951

5052
#### Output
5153

@@ -82,6 +84,8 @@ Get detailed information about a specific book volume
8284
| `apiKey` | string | Yes | Google Books API key |
8385
| `volumeId` | string | Yes | The ID of the volume to retrieve |
8486
| `projection` | string | No | Projection level \(full, lite\) |
87+
| `pricing` | per_request | No | No description |
88+
| `rateLimit` | string | No | No description |
8589

8690
#### Output
8791

0 commit comments

Comments
 (0)