aeo-ai-referral-analytics
Skill5 starsChanged 18 days agoApache-2.0View on GitHub
Measure traffic that AI assistants send to a site, using Google Analytics 4. Use when someone asks "how much traffic comes from ChatGPT/Perplexity/Claude", "are AI answers sending us visitors", "set up an AI traffic channel in GA4", "which pages do AI assistants send people to", or "is our AEO work driving visits". Covers the GA4 query, a reusable referrer regex, landing pages, and why the number is always an undercount. Requires the aeo-toolkit MCP server, signed in to an AEO Toolkit account with Google connected.
In this repository23 other files it gives its agents.
- aeo-ai-crawler-accessSkill
- aeo-answer-first-contentSkill
- aeo-article-author-schemaSkill
- aeo-citation-earningSkill
- aeo-content-freshnessSkill
- aeo-eeat-trust-signalsSkill
- aeo-faq-qa-schemaSkill
- aeo-indexabilitySkill
- aeo-llms-txtSkill
- aeo-local-business-schemaSkill
- aeo-organization-entitySkill
- aeo-page-metadataSkill
- aeo-product-schemaSkill
- aeo-server-renderingSkill
- aeo-site-structureSkill
- aeoSkill
- aeo-structured-data-validationSkill
- aeo-visibility-trackingSkill
- seo-bing-coverageSkill
- seo-cannibalizationSkill
- seo-content-decaySkill
- seo-high-intent-ctrSkill
- seo-traffic-dropSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Not a visibility metric. Whether the site is *cited* is aeo-visibility-tracking.
- Distinctive: line 29
Use a range of at least 28 days.
- Distinctive: line 59
Always state the denominator: AI sessions as a share of all sessions, with both counts.
- Distinctive: line 73
Do not "correct" for undercounting with a multiplier.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI referral analytics (GA4)
AI assistants send some visitors with a referrer or a utm_source tag, and GA4 records
them. That subset is measurable. It is a floor, not the total: most AI influence never
produces a tagged click. Report it as "at least N sessions", never as the size of AI impact.
When this matters / when it doesn't
- Matters: showing whether AEO work produces visits, and which pages earn them.
- Weak evidence on its own: small sites will have tens of sessions, where week-to-week moves are noise. Say so instead of charting a trend.
- Not a visibility metric. Whether the site is cited is
aeo-visibility-tracking.
Steps
list_ga4_properties, confirm the property with the user. Don't guess the ID.- Pull sources, then filter yourself.
ga4_run_reporttakespropertyId,dateRanges,dimensions,metricsandlimitonly: there is no filter argument. So request a broad grouping and filter the returned rows:- dimensions:
sessionSource,sessionMedium(addlandingPagefor step 4) - metrics:
sessions,engagedSessions,keyEvents(use only metric names GA4 accepts for the property; if a call errors, drop the metric rather than guessing) limit: high (e.g. 10000) so the long tail of sources is not truncated. Use a range of at least 28 days. Keep the same length when comparing periods.
- dimensions:
- Match AI sources. Apply the regex in
references/ga4-setup.mdtosessionSource. Also list sources that almost match and any unfamiliar source containingai,gpt,chatorclaude, and show them to the user: new assistants appear faster than any list. Do not silently drop or add rows. - Landing pages. Re-run with
landingPageandsessionSource, filter to the AI sources, rank pages by sessions. These are the pages assistants actually send people to. Compare against pages you expected; mismatches are the useful finding. - Quality. Compare engaged sessions per session and key events for AI sessions against organic search. With under ~30 AI sessions, say the comparison is too thin to read.
- Trend. Re-run
date+sessionSourceweekly if the volume supports it.
How the traffic is tagged
- OpenAI's publisher FAQ states ChatGPT adds
utm_source=chatgpt.comto links it sends, and that this tracking depends on the site allowing OAI-SearchBot. Verified via an excerpt of that FAQ; OpenAI's help pages block automated fetching, so re-read it before quoting. - For other assistants (Perplexity, Claude, Gemini, Copilot) we did not verify referrer hostnames or tagging against primary sources. The regex lists likely hostnames; step 3's "unfamiliar source" review is how you confirm what really appears in this property.
- GA4 dimension names
sessionSource,sessionMedium,sessionDefaultChannelGroup,landingPageandpageReferrerexist in the Data API schema (verified 2026-11-13).pageReferreris the full previous URL, per page, not per session.
How to read the result
- Signal: AI sessions that are consistently present across weeks, concentrated on identifiable pages, with engagement similar to other referral traffic.
- Noise: week-to-week swings on a few dozen sessions; a one-day spike (often a single mention or a crawler/bot).
- Always state the denominator: AI sessions as a share of all sessions, with both counts.
What it cannot tell you (undercounting, be explicit)
- No-click influence. A user reads an answer that names the brand, then searches it or types the URL later. That arrives as organic or direct.
- Stripped or missing referrers. Copied links, apps, in-app browsers and some privacy settings drop the referrer, so visits land in "direct". One secondary source says this happens for in-app browsers and copied links; not confirmed by OpenAI.
- Assistants that don't tag. Without a referrer or UTM, nothing in GA4 identifies them.
- Bot and crawler traffic is not a visitor; GA4 filters known bots, not all of them, so crawler activity needs server logs, not GA4.
- Causality: a visit does not show that an AEO change caused it.
Do not "correct" for undercounting with a multiplier. There is no verified one.
Pitfalls
- Presenting the AI-referral total as total AI impact.
- Reading
directgrowth as AI traffic with no other evidence. - A regex that is stale: review unmatched sources each time.
- Comparing periods of different length or weekday mix.
- Changing the channel definition mid-trend without noting the date.
Sources
- GA4 Data API schema, https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema (dimension names), verified 2026-11-13.
- OpenAI Publishers and Developers FAQ, help.openai.com article 12627856 (
utm_source=chatgpt.com), verified 2026-11-13 via search excerpt only. - OpenAI crawler docs, https://platform.openai.com/docs/bots, verified 2026-11-13.
- Tool behaviour from the aeo-toolkit
ga4_run_reportdefinition, verified 2026-11-13. - Hostnames other than chatgpt.com: NOT verified.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

