---
name: google-analytics-ai-assistant-traffic
description: "Every Monday: last week's GA4 sessions from ChatGPT, Perplexity, Gemini, Claude and Copilot, their share of all traffic, and the pages they land on. Use when the user asks for this, or when it runs on a schedule."
---

# GA4 AI assistant traffic report

Every Monday: last week's GA4 sessions from ChatGPT, Perplexity, Gemini, Claude and Copilot, their share of all traffic, and the pages they land on.

AI assistants now cite and link to websites, and those visits land in GA4 as ordinary referrals, scattered between chatgpt.com, perplexity.ai and a dozen others. There is no default channel for them, so most teams cannot say whether the traffic is growing, which pages it lands on, or whether those visitors convert.

The agent filters GA4 by session source with one regular expression, adds up the assistants, and tracks the total week by week. You see the trend, the share of all sessions, and the pages assistants send people to, which is a fair hint of what they quote you on.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- Viewer access to the GA4 property and its numeric property ID.
- Google's open-source Google Analytics MCP server (`analytics-mcp`, read-only scope), or a service account with the Analytics Data API enabled and `GOOGLE_APPLICATION_CREDENTIALS` set.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Filter sessions by AI source** (Google Analytics): Call `runReport` for the last 7 full days with `dimensions: [{ name: "sessionSource" }]`, the metrics `sessions`, `engagedSessions` and `keyEvents`, and a `dimensionFilter` on `sessionSource` with `matchType: "PARTIAL_REGEXP"`, `caseSensitive: false` and the pattern `chatgpt|openai|perplexity|gemini\.google|claude\.ai|copilot|deepseek`.
2. **Get the denominator** (Google Analytics): Run the same date range with no filter and no dimension for total sessions, so the card can show the AI share.
3. **See where they land** (Google Analytics): Repeat the filtered report with `landingPagePlusQueryString` as the dimension and keep the top 10 pages by sessions, with key events for each.
4. **Build the trend**: On the first run, backfill with one filtered report over the last 56 days with the `isoYearIsoWeek` dimension. Afterwards, compare with the stored weeks. Group sources into assistants (all `chatgpt.com` and `chat.openai.com` rows count as ChatGPT).
5. **Post the tile**: AI assistant sessions is the headline with 8 weeks of history. Share of sessions and key events go in the glance; sessions by assistant and the landing pages open with the card.

## Route B: the browser

### What you need

- Signed in to Google with at least Viewer access to the GA4 property.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://analytics.google.com/analytics/web/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Open an exploration on the right property**: The URL opens the property you used last; switch with the property picker at the top left. Go to **Explore** and create a blank (free form) exploration, because the standard report's search box only does a contains match, not the pattern this report needs.
2. **Set dates, dimension and filter**: Date range: the last 7 full days (last Monday through Sunday), with **Compare** to the previous period. Rows: `Session source`. Values: `Sessions`, `Engaged sessions`, `Key events`. Add a filter: Session source **matches regex** `chatgpt|openai|perplexity|gemini\.google|claude\.ai|copilot|deepseek`.
3. **Get the denominator**: Open **Reports > Acquisition > Traffic acquisition** with the same date range and read total sessions from the totals row, so the AI share can be worked out.
4. **See where they land**: Back in the exploration, add a second tab with `Landing page + query string` as the row dimension and the same filter; keep the top 10 pages by sessions with their key events.
5. **Build the trend**: On the first run, set the date range to the last 8 weeks and add a tab with `Week` as the row dimension and the same filter, to get one total per week. Group sources into assistants (`chatgpt.com` and `chat.openai.com` are both ChatGPT).

Note: Explorations can be sampled on large properties; the sampling icon at the top right says so. The last day or two of data can still be processing, so a Monday run should end its range on Sunday and accept small revisions. Explorations are kept per user, so save this one and reuse it next week.

## The report

- **AI assistant sessions** last week, with an 8-week trend.
- **Share** of all sessions, and **key events** from those sessions.
- **By assistant**: ChatGPT, Perplexity, Gemini, Copilot, Claude and others.
- **Top landing pages** for AI traffic.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "google-analytics-ai-assistant-traffic/<date of this run, e.g. 2026-10-16>",
  "item_key": "google-analytics-ai-assistant-traffic",
  "project": "example.com",
  "source": "GA4 AI assistant traffic report skill",
  "kind": "metric",
  "title": "AI assistant sessions up 14% to 1,284",
  "metric": {
    "label": "AI assistant sessions",
    "value": 1284,
    "better": "higher",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": {
    "type": "Grid",
    "props": {
      "columns": 3
    },
    "children": [
      {
        "type": "Stat",
        "props": {
          "label": "Share of sessions",
          "value": 2.9,
          "unit": "%",
          "delta": 12
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "Key events",
          "value": 96,
          "delta": 20
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "From ChatGPT",
          "value": 842,
          "delta": 11
        }
      }
    ]
  },
  "widget": [
    {
      "type": "Bars",
      "props": {
        "items": [
          {
            "label": "ChatGPT",
            "value": 842
          },
          {
            "label": "Perplexity",
            "value": 196
          },
          {
            "label": "Gemini",
            "value": 118
          },
          {
            "label": "Copilot",
            "value": 74
          },
          {
            "label": "Claude",
            "value": 54
          }
        ],
        "unit": "sessions"
      }
    },
    {
      "type": "Table",
      "props": {
        "columns": [
          "Landing page",
          "Sessions",
          "Key events"
        ],
        "align": [
          "left",
          "right",
          "right"
        ],
        "rows": [
          [
            "/templates/invoice",
            318,
            31
          ],
          [
            "/blog/net-30-payment-terms",
            204,
            9
          ],
          [
            "/pricing",
            161,
            28
          ],
          [
            "/",
            122,
            11
          ]
        ]
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: Mondays at 8:00 (`0 8 * * 1`). From cron, with the agent signed in on that machine:

```bash
0 8 * * 1 claude -p "Run the google-analytics-ai-assistant-traffic skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/google-analytics-ai-assistant-traffic#schedule

Source: https://briefkin.dev/skills/google-analytics-ai-assistant-traffic
