Skip to main content
AI Platforms· 12 min read

How to Track AI Traffic in Google Analytics 4 (GA4 Setup)

Learn how to track AI traffic in Google Analytics 4 with a GA4 setup for ChatGPT, Perplexity, and Claude, plus reporting and fixes.

Ivan Miragaya Mendez
Ivan Miragaya Mendez
Founder @ LLM Monitor

*Meta description:* How to Track AI Traffic in Google Analytics 4 (GA4) with a clean setup for AI assistants, AI search surfaces, and attribution.

*Slug:* how-to-track-ai-traffic-in-google-analytics-4-ga4-setup

Overview

Tracking AI-driven visits in GA4 is less about a single “magic report” and more about making sure your property can consistently recognize where sessions came from. Because GA4’s labeling can vary by platform, browser, privacy settings, and how referrals are passed, the most reliable approach is to (1) inspect your own session source/medium values, then (2) build a repeatable grouping/filtering method for AI sources.

This guide focuses on practical GA4 setup steps you can reuse for monthly reporting, and it also clarifies what you can and can’t infer from GA4 alone.

> Note on attribution and terminology: GA4 reports are based on the data your property receives (e.g., source/medium, referrer, campaign parameters). GA4 does not inherently know that a visit originated from an “AI assistant” unless the incoming request is labeled in a way your GA4 property can capture. For that reason, the guide uses conditional language like “may,” “often,” and “check your property’s values.”

What counts as “AI traffic” in GA4?

In this article, AI traffic means sessions where the incoming request is associated with an AI assistant or AI answer/search surface *as reflected in your GA4 session source/medium (or related acquisition dimensions).* In practice, that often includes sessions that arrive from domains or referrers associated with AI platforms.

Because GA4’s attribution depends on how the referrer/source is recorded, you should treat AI traffic classification as a property-specific rule:

  • If your GA4 session source/medium (or referrer) indicates an AI platform, you can group it as AI traffic. - If it lands in a generic bucket (e.g., broad referral), you may still have the session. But you may not have clean AI-specific reporting until you adjust your grouping logic.

What to measure first

To connect AI visibility to outcomes, start with a small set of metrics that answer three questions:

1. Volume: Are AI-attributed sessions happening?

2. Content impact: Which landing pages are those sessions reaching?

3. Business impact: Do those sessions drive conversions and meaningful engagement?

A practical starting set is:

  • Sessions from AI-attributed sources
  • Landing pages for those sessions
  • Conversions tied to those sessions
  • Engagement rate and average engagement time

> About “citation frequency” and “Share of Voice”: GA4 can help you measure traffic and engagement. But it does not directly measure how often you were cited or recommended inside an AI model’s answers. If you need citation/recommendation frequency, you typically need an additional measurement layer (e.g., an LLM monitoring workflow). The guide mentions these concepts so you can plan your measurement stack, but it does not claim GA4 alone provides them.

AI platforms to consider (and why your property may differ)

Many teams begin with the major AI assistant and AI answer/search surfaces they care about. Common examples include ChatGPT, Perplexity, Claude, Gemini, Google AI Overviews, and Microsoft Copilot.

However, not every platform will appear the same way in GA4. Some may show up clearly in session source/referrer; others may be grouped into broader categories depending on how the platform passes referral information.

Actionable takeaway: don’t assume a platform will always map to a specific GA4 source value. Instead, inspect your GA4 data first, then build your rule around what you actually see.

The GA4 setup path for usable AI attribution

The goal is repeatable reporting you can validate and reuse. Use this workflow:

1. Open GA4 and review Traffic acquisition. Identify how your property currently categorizes sessions (e.g., source/medium, channel groupings). 2. Check whether any AI-related grouping already exists. Look for existing custom channel groupings, filters, or segments. 3. Review session source values for AI platforms you care about. Pull a sample of sessions you believe are AI-driven and note the session source/referrer values recorded in GA4. 4. Create a custom channel group or exploration filter for AI sources. Build a rule that groups the AI-related source values you observed. 5. Validate the rule against landing pages and conversions. Confirm that the grouped sessions land on the expected pages and behave plausibly (e.g., engagement and conversion patterns). 6. Save the setup for reuse in monthly reporting. Store the exploration/segment/report configuration so you can rerun it consistently.

Where “LLM monitoring” can complement GA4

If your objective includes how often you were mentioned, cited, or recommended inside AI answers, GA4 may not be sufficient by itself. In that case, pair GA4’s traffic measurement with an LLM monitoring approach that measures model outputs directly.

How to build a clean AI source rule (without swallowing unrelated referrals)

A “clean” rule groups obvious AI sources while minimizing false positives.

Start with what your GA4 property actually records:

  • Use the domains/referrers that appear in your session source data.
  • Test your rule against real sessions.

Then iterate:

  • If the filter is too broad, you may overcount. - If it’s too narrow, you may miss AI traffic.

Example starting source list (verify in your property)

A common starting point for AI-related domains includes:

  • chatgpt.com / chat.openai.com
  • perplexity.ai
  • claude.ai
  • gemini.google.com
  • copilot.microsoft.com

Use this as a starting hypothesis, then compare it to the actual session source values in your GA4 property. The “right” list is the one that matches what your GA4 property captures.

How to read AI traffic in GA4 reports

Different questions require different GA4 views:

  • Traffic acquisition: best for initial volume and channel/source context.
  • Explorations: best for custom breakdowns and validation.
  • Conversions: best for business impact.

A simple interpretation framework:

  • Sessions indicate whether AI-attributed traffic exists. - Landing pages show what content AI surfaces are sending people to. - Conversions indicate whether that traffic is valuable. - Engagement metrics help you judge whether visits are meaningful.

> Important: GA4 attribution is not the same as “model-level” attribution. GA4 tells you what arrived and how your property recorded it; it does not prove why an AI model recommended your page.

References (sourcing)

  • Google Analytics 4 documentation, Traffic acquisition and acquisition reporting concepts: https://support.google.com/analytics/
  • Google Analytics 4 documentation, Segments and Explorations (for custom analysis): https://support.google.com/analytics/
  • Google Analytics 4 documentation, Attribution and how GA4 records source/medium/referrer: https://support.google.com/analytics/

> Platform-specific referral labeling can vary. When you build your AI source rule, rely primarily on what you observe in your own GA4 session source values.

---

FAQ

1) How can I tell whether a session is really from an AI assistant in GA4?▾

You can’t always know with certainty from GA4 alone, because GA4 depends on how the incoming request is labeled (source/medium, referrer, or campaign parameters). The most reliable method is to inspect your GA4 session source values for sessions you suspect are AI-driven, then build a rule that matches the values your property actually records.

2) Why does AI traffic sometimes appear as generic referral in GA4?▾

AI platforms may not always pass a clear referrer or may be categorized differently depending on browser behavior, privacy settings, and how the platform performs navigation. As a result, sessions can land in broader buckets. The fix is usually to adjust your grouping/filtering logic based on observed session source values rather than assumptions.

3) What’s the difference between measuring AI traffic in GA4 and measuring citations/recommendations?▾

GA4 measures what happened after a user arrived at your site, sessions, engagement, landing pages, and conversions, based on GA4’s recorded acquisition data. Citation or recommendation frequency is typically about what the AI model output said, which GA4 does not directly capture. For that, you usually need an additional monitoring workflow.

4) Should I use a custom channel group or an exploration filter for AI sources?▾

Either can work. A custom channel group is useful if you want AI traffic to appear consistently across standard reports. An exploration filter/segment is often faster for validation and for answering specific questions. Many teams start with an exploration to validate, then move the logic into a reusable channel/segment.

5) How do I validate that my AI source rule isn’t overcounting?▾

Validate by sampling sessions included by your rule and checking whether they align with your expectations (e.g., landing pages, engagement patterns, and whether the source values truly correspond to the AI platforms you intended). If you see unrelated traffic included, narrow the match criteria; if you see missing AI traffic, broaden carefully.

6) Can I automate monthly reporting for AI traffic in GA4?▾

Yes. Once you have a validated segment/exploration or a custom channel grouping, you can reuse it for recurring reporting. The key is to keep the rule tied to observed session source values in your property and to re-check periodically, since platform referral behavior can change.

---

Schema Markup (JSON-LD)

```json

{

"@context": "https://schema.org",

"@type": "Article",

"headline": "How to Track AI Traffic in Google Analytics 4 (GA4 Setup)",

"mainEntityOfPage": {

"@type": "WebPage",

"@id": "https://example.com/how-to-track-ai-traffic-in-google-analytics-4-ga4-setup"

},

"articleSection": "Analytics",

"inLanguage": "en",

"about": ["Google Analytics 4", "AI traffic", "attribution"],

"mentions": ["ChatGPT", "Perplexity", "Claude", "Gemini", "Google AI Overviews", "Microsoft Copilot"],

"author": {

"@type": "Organization",

"name": "Your Organization"

},

"publisher": {

"@type": "Organization",

"name": "Your Organization",

"logo": {

"@type": "ImageObject",

"url": "https://example.com/logo.png"

}

},

"faqPage": {

"@type": "FAQPage",

"mainEntity": [

{

"@type": "Question",

"name": "How can I tell whether a session is really from an AI assistant in GA4?",

"acceptedAnswer": {

"@type": "Answer",

"text": "You can’t always know with certainty from GA4 alone, because GA4 depends on how the incoming request is labeled (source/medium, referrer, or campaign parameters). The most reliable method is to inspect your GA4 session source values for sessions you suspect are AI-driven, then build a rule that matches the values your property actually records."

}

},

{

"@type": "Question",

"name": "Why does AI traffic sometimes appear as generic referral in GA4?",

"acceptedAnswer": {

"@type": "Answer",

"text": "AI platforms may not always pass a clear referrer or may be categorized differently depending on browser behavior, privacy settings, and how the platform performs navigation. As a result, sessions can land in broader buckets. The fix is usually to adjust your grouping/filtering logic based on observed session source values rather than assumptions."

}

},

{

"@type": "Question",

"name": "What’s the difference between measuring AI traffic in GA4 and measuring citations/recommendations?",

"acceptedAnswer": {

"@type": "Answer",

"text": "GA4 measures what happened after a user arrived at your site, sessions, engagement, landing pages, and conversions, based on GA4’s recorded acquisition data. Citation or recommendation frequency is typically about what the AI model output said, which GA4 does not directly capture. For that, you usually need an additional monitoring workflow."

}

},

{

"@type": "Question",

"name": "Should I use a custom channel group or an exploration filter for AI sources?",

"acceptedAnswer": {

"@type": "Answer",

"text": "Either can work. A custom channel group is useful if you want AI traffic to appear consistently across standard reports. An exploration filter/segment is often faster for validation and for answering specific questions. Many teams start with an exploration to validate, then move the logic into a reusable channel/segment."

}

},

{

"@type": "Question",

"name": "How do I validate that my AI source rule isn’t overcounting?",

"acceptedAnswer": {

"@type": "Answer",

"text": "Validate by sampling sessions included by your rule and checking whether they align with your expectations (e.g., landing pages, engagement patterns, and whether the source values truly correspond to the AI platforms you intended). If you see unrelated traffic included, narrow the match criteria; if you see missing AI traffic, broaden carefully."

}

},

{

"@type": "Question",

"name": "Can I automate monthly reporting for AI traffic in GA4?",

"acceptedAnswer": {

"@type": "Answer",

"text": "Yes. Once you have a validated segment/exploration or a custom channel grouping, you can reuse it for recurring reporting. The key is to keep the rule tied to observed session source values in your property and to re-check periodically, since platform referral behavior can change."

}

}

]

},

"howTo": {

"@type": "HowTo",

"name": "Track AI traffic in GA4 with a reusable AI source rule",

"step": [

{

"@type": "HowToStep",

"position": 1,

"name": "Review Traffic acquisition in GA4",

"text": "Open GA4 and review Traffic acquisition to understand how your property currently categorizes sessions (e.g., source/medium and channel groupings)."

},

{

"@type": "HowToStep",

"position": 2,

"name": "Check for existing AI-related grouping",

"text": "Look for any existing custom channel groupings, filters, or segments that might already separate AI traffic."

},

{

"@type": "HowToStep",

"position": 3,

"name": "Inspect session source values for AI platforms",

"text": "Review session source (and related acquisition/referrer values) for sessions you believe are AI-driven, and note the exact values recorded in your GA4 property."

},

{

"@type": "HowToStep",

"position": 4,

"name": "Create a custom channel group or exploration filter",

"text": "Build a reusable rule that groups the AI-related source values you observed, using a custom channel group and/or an exploration filter/segment."

},

{

"@type": "HowToStep",

"position": 5,

"name": "Validate with landing pages and conversions",

"text": "Validate the grouped sessions by checking landing pages and whether conversions and engagement patterns are plausible for your AI-attributed traffic."

},

{

"@type": "HowToStep",

"position": 6,

"name": "Save for monthly reuse",

"text": "Save the exploration/segment/report configuration so you can rerun it consistently for monthly reporting and ongoing monitoring."

}

]

}

}

```

→

See exactly how AI talks about your brand

LLM Monitor runs your queries across ChatGPT, Gemini, Claude, and Perplexity on a schedule — and tells you when your visibility shifts. Free to start, no credit card required.

Start your free trial
Ivan Miragaya Mendez

Ivan Miragaya Mendez

Technical SEO Specialist & Search Automation Builder

Ivan is a Technical SEO Specialist and digital product builder specializing in search automation and agentic AI systems. He focuses on developing scalable systems that improve how websites grow through search.

With experience at market-leading firms such as MVF and Cushman & Wakefield, Ivan has worked on large-scale websites and complex search environments, applying a data-driven and experimentation-led approach to SEO and digital product development.

Alongside his SEO work, Ivan builds automation workflows and tools using technologies such as Python and n8n, helping teams streamline processes and operate more efficiently. He is particularly interested in the evolving role of AI in search and the systems powering the next generation of Generative Engine Optimization (GEO).

Stop guessing. Start tracking.

See exactly how ChatGPT, Gemini, and Perplexity talk about your brand — and how your competitors compare.

Start your free trial