> ## Documentation Index
> Fetch the complete documentation index at: https://vexidata.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Analytics

> Connect Google Analytics to VexiData to report on GA4 traffic — including visits from AI assistants.

Connect Google Analytics and ask your AI assistant for GA4 reports in natural language — standard and realtime reports, plus a set of tools built for a question GA4 makes hard to answer: how much of your traffic comes from AI assistants.

## Prerequisites

* A Google account with at least **Viewer** access to a GA4 property in [Google Analytics](https://analytics.google.com)
* The **Connect sources** capability in your VexiData organization, to connect the platform — Owners and Admins have it by default

## Connect Google Analytics

**1. Open the Integrations page**

Go to the [**Integrations**](https://vexidata.com/integrations) page in VexiData and find **Google Analytics**.

**2. Sign in with Google**

Click **Connect** and approve Google's consent screen with the account that can see your GA4 properties.

VexiData asks for the `analytics.readonly` scope — it reads reports and configuration and can never change anything in your Analytics account. It also requests your basic Google profile and email address — the email address is what names the connection. Keep the Google Analytics box ticked on the consent screen: without it, the connection is refused and you need to connect again.

> [!NOTE]
>
> Each Google product connects separately. Connecting Analytics does not connect [Search Console](https://vexidata.com/docs/integrations/google-search-console.md) or [Google Ads](https://vexidata.com/docs/integrations/google-ads.md) — each has its own consent flow.

**3. Pick your default properties**

Click the new connection's card to open its page. In the **Settings** card, check the GA4 properties the AI should report on when you don't name one, then click **Save**.

## Managing the connection

To connect another Google account, click **Add account** on the Google Analytics card on the [**Integrations**](https://vexidata.com/integrations) page. Each account becomes its own connection, and the one with the **Primary** badge is the primary, which tools use when a request doesn't name a connection.

Click a connection's card to open its page. It has **Connection details**, **Settings**, and **Connection** cards, plus an [**Access**](https://vexidata.com/docs/workspaces/invite-team-members.md#access-to-a-data-source) section for choosing who can use the connection. From there you can:

* **Set default properties** — in **Settings**, check the GA4 properties the AI uses by default and click **Save**.
* **Make primary** — in **Connection**, make this connection the primary one. The button is hidden on the connection that is already primary.
* **Reconnect** — appears in **Connection** only when Google access has expired (the card shows **Reconnect required**). It runs the consent flow again; sign in with the same account to refresh this connection. A different account is added as a separate connection.
* **Disconnect** — in **Connection**, remove the connection. AI tools stop working for it immediately.

## What the AI can do

| Tool | What it does | Access |
| - | - | - |
| `google_analytics_list_account_summaries` | Lists the GA4 accounts and properties the connection can access. | Read |
| `google_analytics_run_report` | Runs a GA4 report with your choice of dimensions, metrics, and date ranges. | Read |
| `google_analytics_run_pivot_report` | Runs a pivot report for multi-dimensional breakdowns. | Read |
| `google_analytics_run_realtime_report` | Reports activity on your site right now. | Read |
| `google_analytics_admin_read` | Reads account and property configuration — data streams, custom dimensions, key events, and audiences. | Read |
| `google_analytics_ai_traffic_daily` | Charts day-by-day traffic arriving from AI assistants. | Read |
| `google_analytics_ai_traffic_by_engine` | Breaks AI traffic down by engine — ChatGPT, Perplexity, Gemini, Claude, Copilot, and more. | Read |
| `google_analytics_ai_referrals` | Lists the AI referral sources sending visitors to your site. | Read |
| `google_analytics_ai_landing_pages` | Shows which pages visitors from AI assistants land on. | Read |

All Google Analytics tools are read-only, so anyone with access to the connection — including **Members** — can use every one of them.

### Measuring AI-assistant traffic

The `google_analytics_ai_*` tools isolate sessions referred by AI assistants, so you can ask questions like:

* *"How has our ChatGPT traffic trended over the last 90 days?"*
* *"Which AI engine sends us the most visitors?"*
* *"Which blog posts do Perplexity users land on?"*

## Troubleshooting

> [accordion] Connection expired or tools return authorization errors
>
> Google access expires when the account password changes, when access is revoked from the Google account's security settings, or when consent lapses. Open the connection from the **Integrations** page — its card shows **Reconnect required** — and click **Reconnect** in the **Connection** card to run the consent flow again.

> [accordion] A property is missing from the list
>
> VexiData sees exactly the properties the connected Google account can access:
>
> * Check the property appears in [Google Analytics](https://analytics.google.com) when you're signed in with that account
> * Ask a property administrator to grant access under **Admin** > **Property access management**
> * If you connected the wrong Google account, click **Add account** on the **Integrations** page and sign in with the right one — a different account becomes a second connection — then open the wrong connection and click **Disconnect**

> [accordion] Tools don't appear in my AI client
>
> Tools register as soon as the platform is connected, but some clients cache the tool list. Reload or reconnect the VexiData connector in your AI client.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.