Pricing
Pay per usage
Go to Apify Store
Google Analytics MCP Server
MCP server for Google Analytics 4. AI agents can run custom reports, check real-time data, analyze traffic sources, demographics, devices, conversions, and compare date ranges. 12 tools with GA4 Data API.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Actor stats
1
Bookmarked
9
Total users
2
Monthly active users
2 months ago
Last modified
Categories
Share
MCP server enabling AI assistants to query Google Analytics 4 (GA4) data. 12 tools covering custom reports, real-time data, traffic sources, demographics, device breakdown, conversions, date comparisons, and funnel analysis.
Features
- Custom reports โ any combination of dimensions, metrics, date ranges, and filters
- Real-time data โ active users and events right now
- Preset reports โ top pages, traffic sources, demographics, devices, conversions
- Date comparison โ compare any two time periods with % change calculation
- Funnel analysis โ track user flow through specific page paths
- Property discovery โ list all accessible GA4 properties
- Metadata โ discover available dimensions and metrics
Input
{"credentialsJson":"{ ... service account JSON ... }","propertyId":"123456789","toolCall":{"name":"ga_top_pages","arguments":{"start_date":"30daysAgo","end_date":"today","limit":10}}}
Tools (12)
| Tool | Description |
|---|---|
ga_run_report | Custom report with dimensions, metrics, date range, filters |
ga_realtime | Real-time active users and events |
ga_top_pages | Top pages by pageviews or sessions |
ga_traffic_sources | Traffic source breakdown (organic, direct, referral) |
ga_user_demographics | User demographics by country, city, or language |
ga_device_breakdown | Device category split (desktop, mobile, tablet) |
ga_conversions | Conversion and event data |
ga_date_comparison | Compare metrics between two date ranges |
ga_funnel | Page path funnel analysis |
ga_properties | List accessible GA4 properties |
ga_metadata | Available dimensions and metrics for the property |
ga_info | Server info and connection stats |
Setup
- Create a Google Cloud project
- Enable the Google Analytics Data API
- Create a service account and download the JSON key
- In GA4 Admin, add the service account email as a Viewer
- Pass the JSON key as
credentialsJsonand your property ID aspropertyId
Common Queries
Top 10 pages this month:
{"name":"ga_top_pages","arguments":{"limit":10,"start_date":"30daysAgo"}}
Traffic sources last week:
{"name":"ga_traffic_sources","arguments":{"start_date":"7daysAgo"}}
Month-over-month comparison:
{"name":"ga_date_comparison","arguments":{"metrics":["totalUsers","sessions","screenPageViews"],"period1_start":"30daysAgo","period1_end":"today","period2_start":"60daysAgo","period2_end":"31daysAgo"}}
