Get a weekly Google Analytics traffic report, channel by channel, from your AI agent

Every Monday: last week's GA4 sessions, users and key events, each channel set against the week before, and the change worth a look.

Runs
Mondays at 8:00
Posts
Stat tile

What lands on your board

example.comSessions28,640+7% vs previous period, bettervs last report
Active users21,350+5.0% vs previous period, better
Engagement rate61.2%+2.0% vs previous period, better
Key events1,136+8.0% vs previous period
↑ Email +41%↑ Organic Search +10%↓ Paid Search -4%
An example with made-up numbers. Your agent posts your real ones.

What it does

Monday morning in GA4 usually means the Reports snapshot, a date comparison and a few minutes of squinting at which line moved. This skill runs that comparison for you: last week's sessions, active users, engagement rate and key events, split by default channel group and set against the week before.

Founders get one number and its direction. Marketers get the channel that explains it, so a 6% rise reads as "email did it" instead of a mystery.

How it works

  1. 1Pull both weeks in one call

    Call the Analytics Data API runReport on properties/<id> with two dateRanges (last Monday to Sunday, and the week before), dimensions: [{ name: "sessionDefaultChannelGroup" }] and the metrics sessions, activeUsers, newUsers, engagementRate and keyEvents. With two ranges, every row also carries a dateRange value, so each channel comes back once per week.

  2. 2Get the property totals separately

    Run the same report with no dimension for the totals. Users are not additive across channels: someone who arrived by search and later by email counts once in each channel but once overall.

  3. 3

    3Decide which channels moved

    Work out each metric's change in percent. A channel has moved when its sessions changed by 15% or more and by at least 200 sessions; smaller swings are ordinary week-to-week noise.

  4. 4

    4Post the tile

    Sessions is the headline with 8 weeks of history. On the first run, backfill it with one call over the last 56 days and the isoYearIsoWeek dimension. Users, engagement rate and key events go in the glance, the channel split in the opened card, and one line names the channel behind the change.

  5. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

What you get

  • Sessions last week and the change on the week before, with an 8-week trend.
  • Active users, engagement rate and key events, each with its change.
  • Sessions by channel: Organic Search, Direct, Paid Search, Referral, Email and Organic Social, this week and last.
  • One line on the channel that explains the week, for example "Email +41% after Tuesday's newsletter; the rest within a few percent".

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/google-analytics-weekly-traffic-report/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the google-analytics-weekly-traffic-report skill

    Or paste the prompt instead of installing:

    promptUsing the Google Analytics Data API (runReport) for my GA4 property, compare last week (Monday to Sunday) with the week before. Give me sessions, active users, engagement rate and key events for the whole property, each with its change in percent, then sessions by sessionDefaultChannelGroup for both weeks. Treat a channel as moved when its sessions change by 15% or more and by at least 200 sessions. Take user totals from a report without the channel dimension, because users overlap between channels. End with one line naming the channel that explains most of the change.
  3. Put it on a schedule

    Mondays at 8:00, from cron on any machine where Claude Code is signed in:

    crontab0 8 * * 1 claude -p "Run the google-analytics-weekly-traffic-report skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a stat tile. How setup works

View the SKILL.mdRaw file
SKILL.md---
name: google-analytics-weekly-traffic-report
description: "Every Monday: last week's GA4 sessions, users and key events, each channel set against the week before, and the change worth a look. Use when the user asks for this, or when it runs on a schedule."
---

# GA4 weekly traffic report

Every Monday: last week's GA4 sessions, users and key events, each channel set against the week before, and the change worth a look.

Monday morning in GA4 usually means the Reports snapshot, a date comparison and a few minutes of squinting at which line moved. This skill runs that comparison for you: last week's sessions, active users, engagement rate and key events, split by default channel group and set against the week before.

Founders get one number and its direction. Marketers get the channel that explains it, so a 6% rise reads as "email did it" instead of a mystery.

## 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 (Admin > Property settings).
- A Google Analytics MCP server or connector, or a service account with the Analytics Data API enabled, added to the property as a Viewer, with `GOOGLE_APPLICATION_CREDENTIALS` pointing at its key.

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

### Steps

1. **Pull both weeks in one call** (Google Analytics): Call the Analytics Data API `runReport` on `properties/<id>` with two `dateRanges` (last Monday to Sunday, and the week before), `dimensions: [{ name: "sessionDefaultChannelGroup" }]` and the metrics `sessions`, `activeUsers`, `newUsers`, `engagementRate` and `keyEvents`. With two ranges, every row also carries a `dateRange` value, so each channel comes back once per week.
2. **Get the property totals separately** (Google Analytics): Run the same report with no dimension for the totals. Users are not additive across channels: someone who arrived by search and later by email counts once in each channel but once overall.
3. **Decide which channels moved**: Work out each metric's change in percent. A channel has moved when its sessions changed by 15% or more and by at least 200 sessions; smaller swings are ordinary week-to-week noise.
4. **Post the tile**: Sessions is the headline with 8 weeks of history. On the first run, backfill it with one call over the last 56 days and the `isoYearIsoWeek` dimension. Users, engagement rate and key events go in the glance, the channel split in the opened card, and one line names the channel behind the change.

## Route B: the browser

### What you need

- Signed in to Google with the Viewer role or higher on the GA4 property; the property must be selected before the reports load.

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 Traffic acquisition for the property**: The URL opens the last property you used; switch with the account picker at the top left if it is the wrong one. Go to Reports > Acquisition > Traffic acquisition and make sure the primary dimension is `Session default channel group`.
2. **Set last week against the week before**: In the date picker at the top right, choose a custom range from last Monday to last Sunday, switch on Compare, pick `Previous period (match day of week)` and click Apply. Every metric column now shows both weeks and the percentage change.
3. **Read the channel rows and the totals**: Note Sessions, Engagement rate and Key events for Organic Search, Direct, Paid Search, Referral, Email and Organic Social, and for the Totals row. A channel has moved when its sessions changed by 15% or more and by at least 200.
4. **Take users from the snapshot**: Users in the channel table overlap between channels, so open Reports > Reports snapshot with the same dates and comparison and read Active users and New users from the first card there.
5. **Name the channel behind the week**: Work out which channel accounts for most of the change in total sessions and write one line about it. Reports > Reports snapshot already shows the headline comparison, so the browser is a reasonable route for this report.

Note: Sunday can still gain a few sessions for a day or two after the run; a Tuesday read is more final. The channel table shows Active users per channel too, but that column does not add up to the property total, which is why the snapshot supplies it.

## The report

- **Sessions** last week and the change on the week before, with an 8-week trend.
- **Active users**, **engagement rate** and **key events**, each with its change.
- **Sessions by channel**: Organic Search, Direct, Paid Search, Referral, Email and Organic Social, this week and last.
- One line on the channel that explains the week, for example "Email +41% after Tuesday's newsletter; the rest within a few percent".

## 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-weekly-traffic-report/<date of this run, e.g. 2026-10-16>",
  "item_key": "google-analytics-weekly-traffic-report",
  "project": "example.com",
  "source": "GA4 weekly traffic report skill",
  "kind": "metric",
  "title": "Sessions up 6.5% on the week before",
  "metric": {
    "label": "Sessions",
    "value": 28640,
    "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": "Active users",
            "value": 21350,
            "delta": 5
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Engagement rate",
            "value": 61.2,
            "unit": "%",
            "delta": 2
          }
        },
        {
          "type": "Stat",
          "props": {
            "label": "Key events",
            "value": 1136,
            "delta": 8
          }
        }
      ]
    },
    {
      "type": "Badges",
      "props": {
        "items": [
          {
            "label": "↑ Email +41%",
            "tone": "ok"
          },
          {
            "label": "↑ Organic Search +10%",
            "tone": "ok"
          },
          {
            "label": "↓ Paid Search -4%",
            "tone": "bad"
          }
        ]
      }
    }
  ],
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Channel",
          "Sessions",
          "Week before",
          "Change"
        ],
        "align": [
          "left",
          "right",
          "right",
          "right"
        ],
        "rows": [
          [
            "Organic Search",
            12480,
            11390,
            "+10%"
          ],
          [
            "Direct",
            6210,
            6050,
            "+3%"
          ],
          [
            "Paid Search",
            4320,
            4500,
            "-4%"
          ],
          [
            "Referral",
            2150,
            2090,
            "+3%"
          ],
          [
            "Email",
            1880,
            1330,
            "+41%"
          ],
          [
            "Organic Social",
            1600,
            1520,
            "+5%"
          ],
          [
            "Total",
            28640,
            26880,
            "+6.5%"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "Organic Search and Email account for 1,640 of the 1,760 extra sessions. Email jumped 41% after Tuesday's newsletter.",
        "tone": "info"
      }
    }
  ],
  "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-weekly-traffic-report 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-weekly-traffic-report#schedule

Source: https://briefkin.dev/skills/google-analytics-weekly-traffic-report

What your agent needs

  • Viewer access to the GA4 property, and its numeric property ID (Admin > Property settings).

  • A Google Analytics MCP server or connector, or a service account with the Analytics Data API enabled, added to the property as a Viewer, with GOOGLE_APPLICATION_CREDENTIALS pointing at its key.

Connecting Google Analytics

  1. Google Analytics MCP server, Google's own open-source server (analytics-mcp on PyPI, source). It runs locally with pipx run analytics-mcp, offers run_report, run_realtime_report and get_account_summaries, and Google labels it experimental.
  2. Data API with a service account. Enable the Google Analytics Data API in a Google Cloud project, create a service account, add its email as a Viewer on the GA4 property, and point GOOGLE_APPLICATION_CREDENTIALS at its JSON key. The skill also reads GA4_PROPERTY_ID.
  3. Your own Google login. gcloud auth application-default login --scopes https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform --client-id-file=client.json gives the MCP server or a script your user's access without a key file.

Request only analytics.readonly and keep the service account at Viewer: none of these reports needs Editor.

Questions

Why do the channel users not add up to the total?

One person can arrive through search on Monday and through email on Thursday, so they count in both channels but once in the total. That is why the skill reads totals from a separate report without the channel dimension. Sessions do add up.

Last week's numbers changed after the report went out. Why?

GA4 can take 24 to 48 hours to finish processing a day, and hits sent late (from apps that were offline, or through the Measurement Protocol) keep landing. A Monday run includes Sunday, which may still move a little. If that matters to you, schedule it for Tuesday.

Do I need Briefkin to use the GA4 weekly traffic report skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a stat tile, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the Google Analytics pages themselves: the agent opens analytics.google.com/analytics/web in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Watch sessions on your board, run after run

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.