ai-referral-analysis

ai-referral-analysis is a skill for Claude Code from surendranb/google-analytics-mcp. It costs 39 tokens per session (620 once invoked), scanned A, original, MIT.

A guide to measuring website visits that arrive through AI assistants such as ChatGPT, Claude, and Perplexity in Google Analytics 4 (GA4), Google's web-traffic reporting tool.

In plain words
What is it for?
Use it to report AI referral volume and trends, compare AI referrals with SEO or direct traffic, and examine sessions, new users, engagement time, and page views.
Why use it?
It helps separate AI-driven visits from search, direct visits, and other sources so you can see whether they are increasing and whether those visitors engage or convert.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the google-analytics-mcp plugin — 16 skills, 1 MCP server shipped together

Good fit Use it to report AI referral volume and trends, compare AI referrals with SEO or direct traffic, and examine sessions, new users, engagement time, and page views.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/surendranb/google-analytics-mcp/ai-referral-analysis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add surendranb/google-analytics-mcp --skill ai-referral-analysis
Clone the repo
git clone --depth 1 https://github.com/surendranb/google-analytics-mcp

Made for: Claude Code.

Or install google-analytics-mcp, the plugin that ships this one along with the rest of its 16 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-referral-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/ai-referral-analysis/github.svg)](https://agentmods.dev/skills/surendranb/google-analytics-mcp/ai-referral-analysis)
Your own site
<a href="https://agentmods.dev/skills/surendranb/google-analytics-mcp/ai-referral-analysis"><img src="https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/ai-referral-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-referral-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/surendranb/google-analytics-mcp/ai-referral-analysis"><img src="https://agentmods.dev/badge/skills/surendranb/google-analytics-mcp/ai-referral-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 620 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.00620
Opus 5 $0.00019 $0.00310
Sonnet 5 $0.00008 $0.00124
Haiku 4.5 $0.00004 $0.00062

Measured 10d ago against content hash 07f24e0ed058, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

ai-referral-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ai-referral-analysis/SKILL.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Referral Analysis

Measure traffic arriving from AI tools — ChatGPT, Claude, Perplexity, Gemini, Copilot, and others — and understand how it behaves compared to other channels.

When to use

  • You want to quantify how much of your traffic comes from AI assistants
  • You're tracking whether AI-driven discovery is growing over time
  • You want to compare AI referral quality (engagement, conversion) to SEO or direct

Known AI referral sources

These domains appear as sessionSource in GA4 when users click links from AI tools:

Tool Source domains
ChatGPT chatgpt.com, chat.openai.com
Claude claude.ai
Perplexity perplexity.ai
Gemini gemini.google.com
Copilot copilot.microsoft.com, bing.com (when AI-driven)
You.com you.com
Grok grok.x.ai, x.com

Step 1 — Volume and trend

dimensions: ["date", "sessionSource"]
metrics: ["sessions", "newUsers", "userEngagementDuration", "screenPageViews"]
dimension_filter: sessionSource contains "chatgpt.com" OR "perplexity.ai" OR
                  "claude.ai" OR "gemini.google.com" OR "copilot.microsoft.com"
date_range: last 30–90 days

Use date as a dimension to see the growth trend.

Step 2 — Quality comparison

Compare AI referral quality against your other top channels:

dimensions: ["sessionDefaultChannelGroup", "sessionSource"]
metrics: ["sessions", "userEngagementDuration", "screenPageViewsPerSession",
          "keyEvents", "bounceRate"]
date_range: last 30 days

Then filter the results to AI sources and compare engagement metrics against Organic Search and Direct.

Step 3 — Which pages AI drives traffic to

dimensions: ["sessionSource", "landingPage"]
metrics: ["sessions", "userEngagementDuration", "keyEvents"]
dimension_filter: sessionSource contains "chatgpt.com" OR "perplexity.ai" OR "claude.ai"
date_range: last 30 days
order_by: sessions DESC

This shows which content AI tools are citing and sending users to.

Read the full file on GitHub · 69 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 69 lines · 39 tokens per session scan A 07f24e0ed058

Subscribe to this mod's changes

ai-referral-analysis is a skill published in the GitHub repository surendranb/google-analytics-mcp (241 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 620 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories