# Google Analytics MCP server: setup and reporting checks for GA4

Canonical URL: https://www.martechdevs.com/blog/google-analytics-mcp-server

By [Jafrin Akter Alo](https://www.martechdevs.com/authors/jafrin-akter-alo)

Data Engineer and Co-founder, martechdevs

Published: 2025-09-09

Last updated: 2026-10-08

Google’s official Analytics MCP server lets compatible AI clients query GA4 through Google’s reporting APIs. It runs locally and is marked experimental. It can retrieve property information and reports, while Google documents it as read only. Set it up with a permitted Google identity, then test a known report before relying on the assistant’s analysis.

The server makes a GA4 report easier to request. It still returns data shaped by GA4’s metrics, attribution rules and reporting limits. An assistant can put a clear sentence around a misleading comparison just as easily as it can explain a useful one.

Start with an agreed question and a baseline report. If the events or revenue values need attention, [analytics and tracking implementation](https://www.martechdevs.com/analytics-tracking) comes before automating the explanation. The result should make the weekly number easier to defend.

## What can the official server do?

It can retrieve account and property information and request reporting data. Google’s [developer introduction](https://developers.google.com/analytics/devguides/MCP) explicitly says the server supports read requests and cannot edit Analytics configuration or settings.

The [official repository](https://github.com/googleanalytics/google-analytics-mcp) documents tools for account summaries, property details, Google Ads links, standard reports, funnels, custom dimensions and metrics, and realtime reporting. A dimension describes a category, such as a session source; a metric measures something, such as sessions.

Useful initial questions include:

- Which landing pages gained or lost sessions across two complete weeks?
- Which session source and medium combinations account for unassigned traffic?
- Which events appear in the property, and which are marked as key events in the relevant reporting setup?
- How does the purchase event count compare across devices?
- Which custom dimensions are available for the report we want to build?

The assistant should check that a requested field is available before constructing a report. A property can collect an event parameter without exposing it as a registered custom dimension in every reporting surface.

## How does the connection work?

Your AI client starts a local process. That process uses Google credentials to call the Analytics APIs and returns the permitted result to the client.

![Claude Code or Gemini CLI calls a local Analytics MCP process, which uses a Google identity with GA4 access to return reporting API results and metadata.](https://www.martechdevs.com/assets/blog/google-analytics-mcp-server.svg)

Local execution describes where the connector runs. The report result can still enter the AI provider’s conversation context. Include that destination when reviewing data access.

Use a dedicated project and a documented owner where that fits your organisation’s setup. The credentials used by the process must belong to an identity with access to the intended GA4 property. Signing into the right browser account does not prove that the local command is using the same identity.

## How do you set it up in Claude Code?

The setup combines Google credentials with a local MCP command. The commands below follow Google’s repository instructions, using project-local scope for the Claude Code connection.

### Prepare the Google side

1. Install the prerequisites used by the official guide, including `pipx` and the Google Cloud CLI.
2. Enable the Analytics Admin API and Analytics Data API in your chosen Google Cloud project.
3. Configure Application Default Credentials with the Analytics read-only scope.
4. Confirm that the authenticated identity can view the intended GA4 property.
5. Keep the credential file path returned by the login process.

Application Default Credentials, or ADC, is the credential mechanism Google client libraries use to find an authorised identity. Follow Google’s current repository link to the relevant ADC instructions for your login method. Use your organisation’s approved approach to user credentials or service-account impersonation.

### Add the local server

Replace the example values with your own local credential path and Google Cloud project:

```bash
claude mcp add analytics-mcp --scope local \
  -e "GOOGLE_APPLICATION_CREDENTIALS=/absolute/path/to/credentials.json" \
  -e "GOOGLE_PROJECT_ID=your-project" \
  -- pipx run analytics-mcp
```

Restart or reload the relevant client session, inspect `/mcp` and confirm that the server is available. Keep the credential file outside shared repositories. Use the [MCP security checklist](https://www.martechdevs.com/blog/mcp-security-checklist) to review who can read the file and what the connected session can access.

### Test the smallest useful request

Ask the assistant to list the Analytics accounts and properties available to the connection. Select the intended property explicitly. Then request one metric for one complete day with no breakdowns.

Compare the result with the same metric, date and property in GA4. Add dimensions only after that baseline works. This sequence separates connection problems from reporting-scope problems.

## Can you use the same server with Gemini?

Yes. Google’s repository includes setup for Gemini CLI and Gemini Code Assist. It uses the same local server command and credentials, configured in the client’s MCP settings.

Keep the Google identity and property constant when comparing clients. Otherwise, a difference caused by permissions or account selection can look like a difference in model quality.

A saved report specification is useful across clients. Record the property, dates, metrics, dimensions, filters and expected output. The specification should survive a change from one AI application to another.

## Is a hosted connector easier?

A hosted connector can remove the local process and credential-file maintenance from the user’s routine. It introduces another service whose scope, pricing and data handling need review.

Available vendor options include:

- **Supermetrics:** documents [MCP access to Google Analytics and advertising sources](https://supermetrics.com/products/supermetrics-mcp).
- **Windsor.ai:** documents a [GA4 connection through its own MCP service](https://windsor.ai/connect/google-analytics-4-mcp).
- **Funnel:** provides a [hosted MCP quick-start guide](https://help.funnel.io/en/articles/15014203-quick-start-guide-using-funnel-mcp) for querying data available through Funnel.

These are vendor services with their own account and data models. Compare the exact fields, freshness, account permissions and limits needed for your report. A connector that combines several advertising sources may be worth considering if the team already uses it for reporting.

For a single analyst comfortable maintaining local tools, Google’s server is a practical starting point. For a team that needs centrally managed connections, assess hosted access or an [internal MCP server](https://www.martechdevs.com/blog/internal-mcp-server) against the same test report.

## How is this different from Ask Advisor inside GA4?

Ask Advisor is Google’s conversational experience inside Analytics. Google’s [current help page](https://support.google.com/analytics/answer/16675569?hl=en) labels it beta and says answers about Analytics data rely on the selected property’s information.

Use it when the question belongs entirely inside that property and the feature is available to your account. An external MCP client is useful when the workflow also involves files, a maintained analysis procedure or other permitted systems.

For example, GA4 can show a change in recorded purchases. Explaining whether the same period had more refunded subscriptions requires billing evidence. The additional connection needs a valid account match and a consistent revenue definition.

## Why can MCP answers differ from the GA4 interface?

Compare the reporting surface and query definition. The server accesses reporting APIs, while the screen you are checking may apply a different metric, scope, filter or data treatment.

Google’s [reporting surfaces comparison](https://support.google.com/analytics/answer/13644080?hl=en) documents differences between the interface, Data API and BigQuery export. API results can involve sampling, thresholding or high-cardinality aggregation. BigQuery contains exported event-level data without all the additions used in GA4 reporting.

Work through these checks in order:

1. **Property and dates:** confirm both sides use the same property, reporting time zone and complete window.
2. **Metric:** distinguish active users, total users, sessions and event count.
3. **Traffic scope:** session acquisition and first-user acquisition answer different questions.
4. **Filters:** match event names, hostnames, channel conditions and exclusions.
5. **Attribution:** check the dimension and metric combination used to allocate credit.
6. **Completeness:** inspect limits, pagination and available response metadata.
7. **Freshness:** allow for processing when recent data is involved.

Google also documents [processing and other differences between reports and explorations](https://support.google.com/analytics/answer/9371379). Save the exact request with the result. “Claude says something different” is difficult to diagnose; a specific metric and filter mismatch is actionable.

## What does a useful analysis prompt look like?

Ask for a bounded comparison, supporting rows and alternative explanations. Keep a reported change separate from a claim about its cause.

> Compare sessions and purchase event counts for the last two complete Monday-to-Sunday weeks. Use session source and medium, the property’s reporting time zone and the same filters in both periods. Show absolute changes, percentage changes and totals. Flag partial results or reporting limits. Suggest checks for the largest changes without asserting a cause the data cannot establish.

Then ask a follow-up tied to the output:

> For the source and medium with the largest decline in purchases, break the result down by device and landing page. Keep the dates and filters unchanged. Explain whether the decline comes mainly from fewer sessions or a lower observed purchase rate.

This progression gives the assistant a reason to request more detail. Asking for every dimension at once makes the result harder to interpret and may consume more reporting resources.

## What does the worked calculation look like?

**Illustrative example:** a small ecommerce team sees purchases fall from 120 to 84 between two complete weeks. Sessions fell from 6,000 to 4,200.

The purchase count declined by 36, or 30%. Sessions also declined by 30%. The ratio of purchase events to sessions is 2% in each period:

- First period: 120 ÷ 6,000 = 2%.
- Second period: 84 ÷ 4,200 = 2%.

That directs the next investigation towards acquisition volume. It does not establish why traffic fell. Check campaign delivery, tagging changes, source allocation and site availability before making that claim.

Also label the ratio correctly. Purchase event count divided by sessions can include more than one purchase in a session. It is not automatically the same measure as the percentage of sessions containing a purchase.

If report preparation falls from 75 minutes to 25 minutes a week, the modelled saving is 50 minutes. At an assumed internal cost of $60 an hour, that is $50 weekly before review overhead, subscriptions or maintenance. Measure the time during the pilot and keep revenue-impact claims separate.

## Will repeated questions hit API quotas?

They can. Google’s [Data API quota documentation](https://developers.google.com/analytics/devguides/reporting/data/v1/quotas) currently lists 200,000 core tokens per property per day and 10 concurrent core requests for standard properties. These are API quota units, separate from the tokens charged by an AI model.

The cost of a request depends on its complexity, including dates, dimensions and filters. Several assistants, dashboards and integrations can draw on the same property’s reporting capacity.

For routine reporting, save successful query definitions, reuse permitted results where freshness allows and avoid repeated broad requests. When a quota error appears, reduce concurrency and inspect the request pattern instead of retrying indefinitely.

## When should you use BigQuery instead?

Use the export when the question needs event-level joins, custom definitions or data from outside Analytics. Examples include connecting acquisition to paid invoices or examining a specific event sequence under your own rules.

The [GA4 BigQuery export guide](https://www.martechdevs.com/blog/ga4-bigquery-export) covers that setup. It also explains why reproducing a GA4 screen in SQL can require more than counting exported rows.

A warehouse connection adds responsibility for query cost, identity matching and access control. Move to it because the question needs that detail. A standard GA4 report may remain the simpler answer for a routine traffic review.

## What should you check before sharing the report?

- [ ] The account and property are explicit.
- [ ] The reporting time zone and complete date windows are recorded.
- [ ] Metric names and traffic scope match the intended question.
- [ ] Filters are the same across comparison periods.
- [ ] Missing dimensions and partial results are visible.
- [ ] A baseline result has been compared with the same reporting definition in GA4.
- [ ] Percentage changes handle zero in the comparison period.
- [ ] The explanation separates observed change from proposed cause.
- [ ] The report links to its source or saves the reproducible request.
- [ ] Credentials and unnecessary personal data are excluded from the output.

At Martechdevs, we build the data access, definitions and working instructions behind repeatable AI workflows. Start with the [free martech AI audit](https://www.martechdevs.com/martech-ai-audit), or explore an [AI assistant built around your approved workflows](https://www.martechdevs.com/custom-martech-ai-agent).

## Frequently asked questions

### Can the official Analytics MCP server change GA4 settings?

Google documents it as read only. It is intended for information retrieval and reporting. A different third-party server may expose other actions, so inspect its tools separately.

### Can ChatGPT read GA4 data?

It can through a compatible integration available to your account and workspace. Google’s local server is not a universal hosted URL that can be pasted into every cloud client. Evaluate a supported hosted connector or a properly deployed custom connection for that use case.

### Why does the assistant see no properties?

Check the identity used by the local credentials and whether it has GA4 property access. Also confirm the required APIs and scopes. The Google Cloud project and the Analytics property are separate parts of the setup.

### Is the official server free?

The repository provides software you can run, while the AI client, hosting choices and maintenance can have costs. Third-party hosted services have their own terms. Compare the complete workflow cost before calling a setup free.

### Does MCP fix unassigned traffic?

It can help investigate the source and medium values involved. Fixing collection and campaign-tagging issues requires changes at their source. The [GA4 unassigned traffic guide](https://www.martechdevs.com/blog/ga4-unassigned-traffic) gives the diagnostic sequence.

## Sources

1. Google, [Try the Google Analytics MCP server](https://developers.google.com/analytics/devguides/MCP), developer documentation, accessed October 2026.

2. Google, [Google Analytics MCP repository](https://github.com/googleanalytics/google-analytics-mcp), setup and tool documentation, accessed October 2026.

3. Supermetrics, [Supermetrics MCP](https://supermetrics.com/products/supermetrics-mcp), accessed October 2026.

4. Windsor.ai, [GA4 MCP connection](https://windsor.ai/connect/google-analytics-4-mcp), accessed October 2026.

5. Funnel, [MCP quick-start guide](https://help.funnel.io/en/articles/15014203-quick-start-guide-using-funnel-mcp), accessed October 2026.

6. Google, [Ask Advisor in Google Analytics](https://support.google.com/analytics/answer/16675569?hl=en), current help, accessed October 2026.

7. Google, [Reporting surfaces comparison](https://support.google.com/analytics/answer/13644080?hl=en), current help, accessed October 2026.

8. Google, [Data differences between reports and explorations](https://support.google.com/analytics/answer/9371379), current help, accessed October 2026.

9. Google, [Data API limits and quotas](https://developers.google.com/analytics/devguides/reporting/data/v1/quotas), current documentation, accessed October 2026.
