Agent Traffic Detection in GA4: Track AI Referrals on Shopify

Agent Traffic Detection in GA4: Track AI Referrals on Shopify

March 4, 2026

AI agents from ChatGPT, Perplexity, Claude, and Copilot are sending traffic to Shopify stores right now -- and most merchants cannot see it. GA4 does not separate AI referral traffic from generic referral traffic by default. This guide walks you through the full detection stack: identifying AI referral sources, building GA4 segments, creating custom channel groupings, adding GTM custom dimensions, and building a Looker Studio dashboard that shows exactly how much revenue AI agents drive to your store.

Analytics Agent's LLM Traffic Dashboard tracks sessions, conversions, and revenue from six AI platforms automatically. If you want to build the same visibility natively in GA4, follow these steps.


Why GA4 does not track agent traffic by default

GA4 categorizes traffic into default channel groups -- Organic Search, Direct, Referral, Paid Search, and so on. When a visitor clicks a link in ChatGPT or Perplexity, GA4 logs it as a generic "Referral" from chat.openai.com or perplexity.ai. It gets buried alongside referrals from forums, newsletters, and random backlinks.

GA4 has no "AI" channel in its default configuration. Google has not added one, and there is no indication they will soon. AI referral traffic stays invisible unless you build the detection yourself.

AI referral traffic behaves differently from traditional referral traffic, and that difference matters. Early data from Conductor and Seer Interactive shows AI-sourced sessions convert at roughly 3x the rate of organic search (Conductor, 2025). The traffic volume is still under 1% of total sessions for most stores, but it is growing fast -- ChatGPT shopping referral traffic grew 805% year-over-year on Black Friday 2025 (Adobe Analytics). If you are not measuring it, you are missing the fastest-growing acquisition channel in ecommerce.

The fix requires four layers:

  1. A GA4 segment that isolates known AI referral sources
  2. Custom channel groupings that create an "AI / Agent" channel
  3. GTM custom dimensions that tag sessions with AI source metadata
  4. A Looker Studio dashboard that reports on AI traffic alongside your other channels

Let us build each one.


Known AI referral sources (complete list)

Before configuring anything, you need the full list of domains and hostnames that AI platforms use when sending traffic. This list is current as of March 2026 and should be reviewed quarterly as new AI agents launch.

Primary AI referral domains

AI Platform Referral Domain(s) Notes
ChatGPT chat.openai.com, chatgpt.com Largest AI referral source by volume
Perplexity perplexity.ai, www.perplexity.ai High purchase intent -- users ask specific product questions
Claude claude.ai, www.claude.ai Growing referral volume since late 2025
Microsoft Copilot copilot.microsoft.com, www.bing.com/chat Bing Chat referrals route through Copilot domain
Google Gemini gemini.google.com, bard.google.com Legacy Bard domain still sends some traffic
Meta AI meta.ai, www.meta.ai Facebook and Instagram AI assistant referrals
DeepSeek chat.deepseek.com, deepseek.com Emerging source, primarily Asia-Pacific traffic
Grok grok.x.ai, x.com/grok X/Twitter's AI assistant
You.com you.com AI search engine with shopping features
Phind phind.com, www.phind.com Developer-focused AI search
Kagi kagi.com Privacy-focused AI search
Arc Search arc.net Browser-integrated AI search

Secondary and emerging sources

AI Platform Referral Domain(s) Notes
Amazon Rufus amazon.com/rufus In-app only; limited external referral
Shopify Sidekick admin.shopify.com Merchant-facing, not shopper-facing
Opera Aria aria.opera.com Browser AI assistant
Brave Leo search.brave.com Brave browser's AI assistant
Samsung Bixby Varies Device-level AI, limited web referral
Apple Intelligence Varies Safari integration, emerging

Save this list. You will use it in every configuration step below.

Action: Bookmark this table. New AI referral sources appear every quarter. Add them to your GA4 segments and channel groupings when they do.


How to set up a GA4 agent traffic segment

A GA4 segment lets you isolate AI referral sessions in your Explore reports. This is the fastest way to start seeing AI traffic data without changing your property configuration.

Step 1: Open GA4 Explore

Navigate to Explore in the left sidebar of your GA4 property. Click Blank to create a new exploration.

Step 2: Create a session segment

  1. Click the + icon next to Segments in the left panel.
  2. Select Session segment.
  3. Name it AI Agent Referrals.

Step 3: Add the referral source conditions

Under Add new condition, select Session source (found under Traffic Source).

Set the condition to matches regex and enter:

chat\.openai\.com|chatgpt\.com|perplexity\.ai|claude\.ai|copilot\.microsoft\.com|gemini\.google\.com|bard\.google\.com|meta\.ai|chat\.deepseek\.com|deepseek\.com|grok\.x\.ai|you\.com|phind\.com|kagi\.com|arc\.net

Click Apply, then Save and apply.

Step 4: Add comparison dimensions

In your Explore, add these dimensions:

  • Session source (to see which AI platform sent the traffic)
  • Landing page (to see which pages AI agents link to)
  • Device category (AI assistant apps vs. desktop browsers)

Add these metrics:

  • Sessions
  • Conversions
  • Total revenue
  • Engagement rate

Step 5: Compare against other channels

Add a second segment for All users or Organic Search to compare AI referral performance side-by-side. This is where you will see the conversion rate difference.

You now have a reusable segment that shows AI agent traffic in any Explore report. But segments only work in Explore -- they do not appear in standard reports. For that, you need custom channel groupings.

If you want this tracking automated and connected to revenue attribution, Analytics Agent's AI traffic tracking does this across six platforms without manual GA4 configuration.

💡 Pro Tip: Analytics Agent automatically tracks all these metrics for you. Install Analytics Agent and get instant insights without the manual work.


How to create custom channel groupings for AI sources

Custom channel groupings let you add an "AI / Agent" channel to your standard GA4 reports. This is the most impactful configuration change because it surfaces AI traffic everywhere -- Acquisition reports, Landing Pages, Conversions, and any report that uses the Channel Group dimension.

Step 1: Navigate to channel groupings

  1. In GA4, go to Admin > Data display > Channel groups.
  2. Click Create new channel group.
  3. Name it Custom Channel Group (AI Included).

Step 2: Create the AI / Agent channel

  1. Click Add new channel.

  2. Name the channel AI / Agent.

  3. Set the condition:

    • Source matches regex: chat\.openai\.com|chatgpt\.com|perplexity\.ai|claude\.ai|copilot\.microsoft\.com|gemini\.google\.com|bard\.google\.com|meta\.ai|chat\.deepseek\.com|deepseek\.com|grok\.x\.ai|you\.com|phind\.com|kagi\.com|arc\.net
  4. Click Save channel.

Step 3: Re-order channel priority

GA4 evaluates channels in order. Place AI / Agent above Referral in the list. This ensures AI traffic gets classified as "AI / Agent" instead of falling into the generic Referral bucket.

To reorder: drag the AI / Agent channel above Referral using the handle on the left side of each row.

Step 4: Copy remaining default channels

Your custom channel group needs to include all the standard channels too. Copy the default conditions for Organic Search, Paid Search, Direct, Social, Email, Display, and Referral into your custom group. GA4 does not inherit defaults automatically in custom groups.

Step 5: Apply and verify

  1. Click Save.
  2. Wait 24-48 hours for data to populate (custom channel groupings are not retroactive).
  3. Go to Reports > Acquisition > Traffic acquisition and select your custom channel group from the dropdown above the table.

You should now see "AI / Agent" as a distinct row in your acquisition reports.

Optional: Split by AI platform

If you want separate channels per AI platform (ChatGPT, Perplexity, Claude, etc.), create individual channels with narrower regex patterns:

Channel Name Source Regex
AI / ChatGPT chat\.openai\.com|chatgpt\.com
AI / Perplexity perplexity\.ai
AI / Claude claude\.ai
AI / Copilot copilot\.microsoft\.com
AI / Gemini gemini\.google\.com|bard\.google\.com
AI / Other meta\.ai|deepseek\.com|grok\.x\.ai|you\.com|phind\.com|kagi\.com|arc\.net

This level of granularity is useful if your agentic commerce attribution model needs platform-level performance data.


Google Tag Manager: custom dimensions for agent attribution

GA4 segments and channel groupings tell you how much AI traffic you get. GTM custom dimensions tell you more about that traffic -- specifically, they let you tag each session with structured metadata about the AI source, query context, and user-agent classification.

What you will build

Three custom dimensions pushed via GTM:

  1. ai_referral_source -- The specific AI platform name (e.g., "chatgpt", "perplexity")
  2. ai_traffic_type -- Whether the session is "ai_referral", "ai_bot", or "organic"
  3. ai_user_agent_class -- Whether the visitor is a human using an AI assistant or an AI crawler/bot

Step 1: Register custom dimensions in GA4

  1. Go to Admin > Custom definitions > Custom dimensions.
  2. Create three new dimensions:
Dimension name Scope Event parameter
AI Referral Source Session ai_referral_source
AI Traffic Type Session ai_traffic_type
AI User Agent Class Session ai_user_agent_class

Step 2: Create a GTM variable for referrer detection

In Google Tag Manager, create a Custom JavaScript variable:

Variable Name: cjs - AI Referral Source

function() {
  var ref = ;
  if (!ref) return 'none';

  var aiSources = {
    'chat.openai.com': 'chatgpt',
    'chatgpt.com': 'chatgpt',
    'perplexity.ai': 'perplexity',
    'claude.ai': 'claude',
    'copilot.microsoft.com': 'copilot',
    'gemini.google.com': 'gemini',
    'bard.google.com': 'gemini',
    'meta.ai': 'meta_ai',
    'chat.deepseek.com': 'deepseek',
    'deepseek.com': 'deepseek',
    'grok.x.ai': 'grok',
    'you.com': 'you',
    'phind.com': 'phind',
    'kagi.com': 'kagi',
    'arc.net': 'arc'
  };

  for (var domain in aiSources) {
    if (ref.indexOf(domain) !== -1) {
      return aiSources[domain];
    }
  }
  return 'none';
}

Step 3: Create a GTM variable for user-agent classification

Create another Custom JavaScript variable:

Variable Name: cjs - AI User Agent Class

function() {
  var ua = navigator.userAgent.toLowerCase();

  var aiBots = [
    'gptbot', 'chatgpt-user', 'oai-searchbot',
    'perplexitybot', 'perplexity-user',
    'claudebot', 'anthropic-ai',
    'bingbot', 'bingpreview',
    'googlebot', 'google-extended',
    'meta-externalagent', 'facebookexternalhit',
    'bytespider', 'deepseekbot',
    'amazonbot', 'cohere-ai'
  ];

  for (var i = 0; i < aiBots.length; i++) {
    if (ua.indexOf(aiBots[i]) !== -1) {
      return 'ai_bot';
    }
  }

  return 'human';
}

Step 4: Create the GA4 event tag

Create a new GA4 Event tag:

  • Tag Name: AI Referral Attribution
  • Measurement ID: Your GA4 Measurement ID
  • Event Name: ai_session_start
  • Event Parameters:
Parameter Name Value
ai_referral_source {{cjs - AI Referral Source}}
ai_traffic_type Use a lookup table: if {{cjs - AI Referral Source}} is not "none", return "ai_referral"; else return "organic"
ai_user_agent_class {{cjs - AI User Agent Class}}

Step 5: Set the trigger

Create a trigger:

  • Trigger Type: Page View
  • Fires on: Some Page Views
  • Condition: {{cjs - AI Referral Source}} does not equal none

This ensures the tag only fires when a session originates from a known AI platform, keeping your event volume lean.

Step 6: Test in GTM Preview

  1. Open GTM Preview mode.
  2. Visit your store using a URL with a simulated AI referrer (use a browser extension to set the referrer header to https://chat.openai.com/).
  3. Verify the ai_session_start event fires with correct parameter values.
  4. Check GA4 DebugView to confirm the custom dimensions populate.

Publish the GTM container once verified.

🔍

See Analytics Agent in Action

Discover how AI-powered insights can transform your Shopify store.

Learn More →

How to identify bot vs. human AI referrals

Not all traffic from AI domains is equal. There are three types:

  1. Human-initiated AI referrals -- A person uses ChatGPT, clicks a product link, and lands on your store. This is the highest-value traffic.
  2. AI crawler/bot traffic -- GPTBot, PerplexityBot, or ClaudeBot crawling your site to index content. Important for AI visibility but not a conversion opportunity.
  3. Automated agent sessions -- AI shopping agents (like ChatGPT shopping or Perplexity's buy feature) that browse your store programmatically to evaluate products. This is the agentic commerce traffic that is growing fastest.

Distinguishing them in GA4

The ai_user_agent_class custom dimension from the GTM setup above handles the bot vs. human split. But distinguishing human-initiated referrals from automated agent sessions requires additional signals.

User-agent strings to watch:

User-Agent Pattern Type Action
ChatGPT-User Automated agent Track separately -- this is agentic commerce
GPTBot Crawler Exclude from conversion reports
PerplexityBot Crawler Exclude from conversion reports
Perplexity-User Automated agent Track -- high purchase intent
ClaudeBot Crawler Exclude from conversion reports
Anthropic-AI Crawler Exclude from conversion reports
Google-Extended Crawler Exclude from conversion reports
Normal browser UA + AI referrer Human click-through Primary conversion audience

Practical filter: In your GA4 Explore reports, use the ai_user_agent_class dimension as a filter. Set it to "human" for conversion analysis and "ai_bot" for crawl coverage analysis.

For a deeper look at how to track AI agent conversions in GA4 on Shopify, including purchase event attribution and revenue tracking, see our dedicated guide.


How to build an agent traffic report in Looker Studio

Looker Studio (formerly Data Studio) turns your GA4 AI traffic data into a shareable dashboard that updates automatically. Here is how to build one.

Step 1: Connect your GA4 data source

  1. Open Looker Studio.
  2. Click Create > Report.
  3. Add Google Analytics as a data source.
  4. Select your GA4 property.

Step 2: Build the AI traffic overview scorecard

Add four scorecards across the top of your dashboard:

Metric Filter Label
Sessions Session source matches AI regex AI Agent Sessions
Conversions Session source matches AI regex AI Conversions
Total Revenue Session source matches AI regex AI Revenue
Engagement Rate Session source matches AI regex AI Engagement Rate

To apply the filter, create a Looker Studio filter where Session source matches the regex from the segments section above.

Step 3: Add an AI platform breakdown table

Create a table with:

  • Dimension: Session source (filtered to AI sources only)
  • Metrics: Sessions, Conversions, Total Revenue, Engagement Rate, Average Session Duration

Sort by Sessions descending. This shows you which AI platforms drive the most traffic and revenue.

Step 4: Add a time-series chart

Create a line chart showing AI sessions over time:

  • Date dimension: Date
  • Metric: Sessions (filtered to AI sources)
  • Comparison: Add a second line for total sessions to show AI traffic as a share of total

Step 5: Add a landing page performance table

Create a table showing which pages AI agents link to most often:

  • Dimension: Landing page
  • Metrics: Sessions, Conversions, Total Revenue
  • Filter: Session source matches AI regex

This tells you which product pages and content pages AI platforms recommend. Use this data to prioritize schema optimization on high-traffic AI landing pages.

Step 6: Add a conversion comparison chart

Create a bar chart comparing conversion rates:

  • AI Agent Referrals vs. Organic Search vs. All Referrals

This visualization is what makes the business case for investing in AI visibility. When your team sees that AI referrals convert at 3x the rate of organic, the priority becomes clear.

Optional: Add the custom dimensions

If you implemented the GTM custom dimensions, add:

  • A pie chart showing AI Traffic Type (ai_referral vs. ai_bot)
  • A table showing AI Referral Source with conversion metrics

Share this dashboard with your team. Set it to refresh daily.


How to automate agent traffic alerts

Manual dashboard checking does not scale. Set up automated alerts so you know when AI traffic spikes, drops, or hits conversion milestones.

GA4 Custom Insights

  1. Go to Home in GA4.
  2. Scroll to Insights and click Create.
  3. Set up a custom insight:
    • Metric: Sessions
    • Condition: Session source matches regex (AI sources)
    • Alert: Notify when sessions increase by more than 50% week-over-week

Create a second alert for drops:

  • Alert: Notify when sessions decrease by more than 30% week-over-week

Looker Studio scheduled emails

  1. In your Looker Studio dashboard, click Share > Schedule email delivery.
  2. Set to weekly (Monday mornings work well).
  3. Add your team's email addresses.

Analytics Agent anomaly detection

Analytics Agent's anomaly detection monitors AI referral traffic alongside all your channels. It polls GA4 every 15 minutes, compares against a 30-day rolling baseline, and emails you when something significant changes. No manual configuration required.

This is especially useful for catching tracking breakage. If AI referral traffic suddenly drops to zero, it usually means a GTM tag stopped firing or a referral domain changed -- not that AI platforms stopped recommending your products.


How this affects your AI visibility

Tracking AI agent traffic is not just a measurement exercise. The data you collect directly informs your AI visibility strategy.

When you can see which AI platforms send traffic, you know where to focus optimization efforts. If Perplexity drives 60% of your AI revenue but ChatGPT drives 60% of your AI sessions, you have two different optimization problems: conversion rate on ChatGPT landing pages and continued visibility on Perplexity.

The landing page data from your Looker Studio dashboard tells you which products AI agents recommend. Cross-reference that with your GA4 setup and structured data implementation to ensure those pages have complete schema markup, fast load times, and accurate pricing data.

Analytics Agent for Shopify ties this together automatically. The LLM Traffic Dashboard tracks sessions, conversions, and revenue from ChatGPT, Claude, Gemini, Perplexity, DeepSeek, and Grok. The AI Ranking Tracker monitors whether AI platforms cite your brand for target queries. Together, they give you the full picture: where you appear, who clicks through, and what converts.

Ready to Unlock Your Analytics Potential?

Connect Analytics Agent to your Shopify store and start making data-driven decisions today.

Get Started Free

FAQ

How much AI referral traffic should I expect?

For most Shopify stores in 2026, AI referral traffic represents 0.5-2% of total sessions. Stores with strong structured data and product reviews see higher AI referral volumes. The number is growing -- ChatGPT shopping referrals grew 805% year-over-year in late 2025 (Adobe Analytics).

Do custom channel groupings apply retroactively?

No. GA4 custom channel groupings only apply to data collected after you create them. Set them up now so you start building historical data. Segments in Explore reports do apply to historical data.

Will this setup work with Shopify's native GA4 integration?

Yes. These configurations are made at the GA4 property level and in GTM. They work regardless of whether you use Shopify's native Google channel integration, a custom GTM setup, or a third-party tracking app.

How often should I update the AI referral source list?

Review quarterly. New AI platforms and domain changes happen regularly. When a major AI product launches (or an existing one changes domains), update your regex patterns in GA4 segments, channel groupings, and GTM variables.

Can I track AI agent traffic without GTM?

Yes, partially. GA4 segments and custom channel groupings work without GTM. You will not get the custom dimensions (ai_referral_source, ai_traffic_type, ai_user_agent_class), but you will still see AI referral traffic in your reports. GTM adds the bot-vs-human classification and structured metadata that make the data actionable.


Next steps

You now have four layers of agent traffic detection in GA4:

  1. GA4 segments for ad-hoc analysis in Explore
  2. Custom channel groupings for standard report visibility
  3. GTM custom dimensions for source classification and bot detection
  4. Looker Studio dashboards for team-wide reporting and automated alerts

This gives you the visibility to measure AI as a real acquisition channel, not a rounding error buried in your Referral bucket.

Connect this data to your LLM traffic tracking strategy and ensure the pages AI agents link to are optimized for conversion. For a broader view of how agent traffic detection fits into your measurement infrastructure, see the agentic commerce analytics stack guide.

Run an AI Ranking Report to see which AI platforms recommend your products today -- then use the agent traffic detection setup above to measure what converts.