AI Agent Analytics

AI agent e-commerce attribution:
tracking ChatGPT and Perplexity traffic

How to identify, segment, and measure the e-commerce revenue coming from AI shopping agents — so you know which structured data improvements are actually driving sales.

TL;DR ChatGPT Shopping sends Referer: https://chatgpt.com/. Perplexity sends Referer: https://www.perplexity.ai/. Both appear as referral traffic in GA4 and Plausible today — no special code needed. The gap is attribution: most merchants haven't created custom channel groups to segment AI agent referrals from generic "referral" traffic. Set that up first, then optimize structured data for the pages that convert AI-referred visitors best.

Where AI agent traffic currently sits in your analytics

If you're using Google Analytics 4, Shopify Analytics, or Plausible, AI agent referral traffic is almost certainly already in your data — just not labeled. It hides in the "Referral" channel under domains like chatgpt.com, perplexity.ai, and occasionally claude.ai.

Merchants who haven't looked at their referral source breakdown are often surprised by how much AI agent traffic they already have, particularly in technology, outdoor gear, beauty, and specialty food categories where AI shopping recommendations are common.

AI agent referrer signatures

AI AgentReferrer domainURL patternNotes
ChatGPT Shoppingchatgpt.comhttps://chatgpt.com/Shopping plugin links open in new tab with full referrer
Perplexity Shoppingperplexity.aihttps://www.perplexity.ai/Product card links in Perplexity answer pages
Google AI Overviewgoogle.comStandard Google referrerMay include utm_source=ai_overview in some cases
Microsoft Copilotbing.com or copilot.microsoft.comVariousCopilot Shopping links may show bing.com or msn.com
Claude.aiclaude.aihttps://claude.ai/Less common; no native shopping tab yet as of 2026
You.comyou.comhttps://you.com/Shopping search tab links

Setting up AI agent channel groups in GA4

In Google Analytics 4, go to Admin → Data Display → Channel Groups → Create New Channel Group. Add conditions for each AI agent referrer:

Channel: AI Shopping Agents
Conditions (match ANY):
  - Session source exactly matches: chatgpt.com
  - Session source exactly matches: perplexity.ai
  - Session source exactly matches: copilot.microsoft.com
  - Session source contains: claude.ai
  - Session source contains: you.com
  - Session medium = referral AND session source contains: bing.com
    AND (utm_source = ai OR page_referrer contains copilot)

Once this channel group is applied, you can segment AI agent sessions in all GA4 reports and see their conversion rate, revenue, and top landing pages separately from organic search and paid traffic.

Parsing AI agent referrers in server access logs

If you use Caddy, Nginx, or Apache with access logging, you can query AI agent referrals directly from server logs without relying on JavaScript analytics (which miss server-side rendered pages and bots):

# Caddy / Nginx — count referrals from AI agents in access log
grep -E '"https://(chatgpt\.com|perplexity\.ai|claude\.ai|you\.com)' /var/log/access.log \
  | awk '{print $7}' \
  | sort | uniq -c | sort -rn \
  | head -20

# Output: which product URLs are getting AI agent referrals
# Example:
#  142 /products/trail-running-shoes
#   89 /products/merino-base-layer
#   44 /collections/all

This tells you which specific product pages AI agents are recommending — invaluable for deciding where to invest structured data improvements next.

Differentiating crawler visits from real customer referrals

A common confusion: AI crawlers (GPTBot, PerplexityBot) and AI agent customer referrals are completely different visits.

Visit typeUser agentReferrer headerShows in GA4?Generates revenue?
AI crawler indexingGPTBot/1.1, PerplexityBot/1.0NoneNo (filtered as bot)No
Customer click from ChatGPTChrome/Safari (real browser)https://chatgpt.com/YesYes
Customer click from PerplexityChrome/Safari (real browser)https://www.perplexity.ai/YesYes

Crawler visits appear only in raw server access logs under their bot user agent strings, never in GA4 or Plausible (both filter them). Customer referral clicks appear in analytics with normal session behavior.

Using structured data to improve AI agent URL citation accuracy

When AI agents decide which URL to cite for a product, they prefer canonical product URLs over collection pages, homepage URLs, or tracking-param variants. Your structured data directly influences which URL gets cited:

<!-- In product JSON-LD: canonical URL must match <link rel="canonical"> tag -->
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "{{ product.title | escape }}",
  "url": "{{ shop.url }}{{ product.url }}",
  "offers": {
    "@type": "Offer",
    "url": "{{ shop.url }}{{ product.url }}",
    "price": "{{ product.price | money_without_currency | remove: ',' }}",
    "priceCurrency": "{{ cart.currency.iso_code }}"
  }
}

Including "url" at both the Product and Offer level ensures the AI agent cites the correct product page URL rather than inferring it from crawl context. This also means your UTM-stripped canonical URL shows up in referral analytics — making attribution cleaner.

Building an AI agent revenue dashboard

Once your GA4 channel group is set up, create an Explorations report tracking these metrics weekly:

MetricGA4 dimensionWhat it tells you
Sessions from AI agentsChannel group = "AI Shopping Agents"Volume of AI-referred visitors over time
Conversion rate by agentSession source × purchase eventWhich AI agent sends the highest-intent visitors
Revenue by agentChannel × purchase revenueDirect revenue attributable to AI channels
Top landing pages from AISession source + landing pageWhich products AI agents recommend most
Bounce rate vs. organicEngagement rate by channelWhether AI-referred visitors match purchase intent

Shopify Analytics: finding AI agent referrals

In Shopify Analytics, go to Reports → Sessions by referrer. Filter the referrer source column for chatgpt.com and perplexity.ai. Shopify's native analytics captures these as referring domains alongside Google, Instagram, and email. You can also check the Top referrers widget on the Overview dashboard.

Shopify does not offer custom channel groups, so GA4 gives you more granular AI agent segmentation. Use both: Shopify Analytics for a quick revenue sanity check, GA4 for detailed behavioral analysis.

Related: AI agent traffic sources overview · AI shopping agent tracking and analytics · Shopify SEO and AI readiness

Frequently asked questions

How can I tell if my traffic is coming from ChatGPT or Perplexity?

Check your analytics referral source for chatgpt.com and perplexity.ai. ChatGPT Shopping and Perplexity Shopping pass their domain as the HTTP Referer header when a user clicks a product link. Both appear as standard referral traffic in GA4 and Plausible.

Does ChatGPT Shopping pass referrer headers?

Yes. ChatGPT Shopping links open in a new tab with Referer: https://chatgpt.com/. This shows in GA4 under referral traffic from chatgpt.com. No special code is needed — it's captured by standard analytics automatically.

How do I differentiate AI crawler visits from real customer referrals?

AI crawlers (GPTBot, PerplexityBot) use bot user agent strings and appear only in server access logs — they don't generate GA4 sessions. Customer clicks from AI platforms show normal browser user agents and standard referrer headers. They're completely separate visit types.

Can structured data help AI agents cite my URL more precisely?

Yes. Including a canonical "url" property in your Product and Offer JSON-LD tells AI agents exactly which URL to cite for the product. This avoids collection pages or param-laden URLs appearing in AI recommendations, and makes attribution cleaner in analytics.