How do you track AI search traffic to a Shopify store?
Count a visit as AI search if either the referring domain or the utm_source belongs to an AI tool. ChatGPT links usually carry utm_source=chatgpt.com, but many arrive with no referrer, so referrer-only reports file them as direct. When we recounted October for mymully.com, referrers alone showed 0 ChatGPT sessions. Adding the UTM tag found 65. Perplexity mostly sends a referrer, so it barely changed.
Last week our SEO agent reported that AI search sent mymully.com 32 visits in October. This week we reran the numbers a second way, and got 98 from ChatGPT and Perplexity alone. Same store, same month, same analytics tool. The only change was the rule for what counts as an AI visit.
If you are deciding whether AI search is worth working on, that rule decides your answer. This guide covers the rule we use now, the query behind it, and the traps we hit.
How do you know a visit came from ChatGPT or Perplexity?
Look for two signals and count the visit if either one is present: the referring domain, and the utm_source tag on the landing URL. ChatGPT adds utm_source=chatgpt.com to links in its search results, according to OpenAI's publisher FAQ as captured on October 4, 2026 (OpenAI Help Center, archived). That page now redirects elsewhere, but the tagged visits keep arriving in our data, including 11 sessions in the first days of November.
The referrer is the weaker signal. Browsers decide how much referrer information to send, and the default policy sends only the origin across sites, or nothing in some cases (MDN). Apps and in-app browsers often send nothing at all.
What did the recount show for our store?
Most ChatGPT visits had the tag but no referrer. Here are mymully.com sessions in PostHog, counted two ways:
| Month (2026) | ChatGPT, referrer only | ChatGPT, referrer or tag | Perplexity, referrer only | Perplexity, referrer or tag |
|---|---|---|---|---|
| August | 28 | 86 | 21 | 22 |
| September | 12 | 69 | 46 | 53 |
| October | 0 | 65 | 28 | 33 |
Two things stand out. First, ChatGPT referrers faded to zero while tagged visits stayed between 65 and 86 a month. A referrer-only report would have told us ChatGPT traffic died. It did not. Second, Perplexity mostly sends a referrer, so the rule barely moves its count.
The landing pages were useful too. In October, ChatGPT visits landed most on our homepage, our golf outings page, the subscription page and a Greyson vs Peter Millar comparison post. Those are the pages to keep sharp.
Why do analytics tools miss it?
Because default channel rules usually look at the referrer. PostHog's built-in "AI" channel type matches when the referring domain is on its list of AI sources, such as chatgpt.com, claude.ai and perplexity.ai (PostHog Docs). A visit with utm_source=chatgpt.com and no referrer will not match that rule. PostHog does capture UTM tags on every event and on the session (PostHog Docs), so the data is there. You just have to ask for it, or add a custom channel type.
We hit a second trap first. mymully.com logs pageviews as a custom event called page_view, not PostHog's default $pageview. Our first query filtered on $pageview and returned nothing. Check what your site actually sends before you trust an empty result.
How do you set up the count?
Write one rule and use it everywhere. Our steps:
- List the AI sources. chatgpt.com, perplexity.ai, claude.ai, gemini.google.com, copilot.microsoft.com. Match exact hostnames, not loose text.
- Count a session if either signal matches. Referring domain or utm_source, at the start of the session.
- Save the source on first touch. On agentcocoon.com, a small script tags a visit from a known referrer as o-chatgpt, o-perplexity, o-google and so on, and stores it so later pages and signups keep it. The same saved source rides into Stripe, as covered in how to know which ad a Stripe checkout came from.
- Report AI next to Google clicks. We track one organic number: Google clicks plus AI visits.
- Log the landing page. It tells you which pages AI tools are actually sending people to.
A query like this, in PostHog's SQL, gives the monthly count:
sql
select toStartOfMonth(timestamp) as month,
count(distinct if(properties.utm_source = 'chatgpt.com'
or properties.$referring_domain = 'chatgpt.com', $session_id, null)) as chatgpt
from events
where timestamp >= '2026-08-01'
group by month order by month
What can first-touch tagging get wrong?
It keeps the first source, so a later AI visit can hide behind an earlier one. On agentcocoon.com, Perplexity was the referrer on 7 visits between October 29 and November 2, but only 1 was tagged o-perplexity. The other 6 carried an ad tag, either in the landing URL or saved from an earlier ad click. That is the right behavior for paying ad platforms back. It is the wrong one if you want to know how often AI tools send someone. Report both: first-touch source for conversions, and raw referrer counts for reach.
What should you do with the number?
Watch the trend and the landing pages, not the absolute count. AI visits are still small next to Google for most stores, ours included. What matters is whether the pages you improve start getting more of them, and whether those visitors buy. If the count moves sharply in either direction, check the rule and the tagging before you celebrate or panic.
Common questions
Does Shopify's own analytics show AI search traffic?
Shopify reports sessions by referrer, so the same gap applies. Visits that arrive with only a UTM tag and no referrer can land under direct. Check your landing page URLs for utm_source=chatgpt.com to see how many you are missing, or send traffic data to a tool where you can write the rule yourself.
Which AI tools should I include in the rule?
At minimum chatgpt.com, perplexity.ai, claude.ai, gemini.google.com and copilot.microsoft.com, matched on the exact hostname. Add any others that show up in your referrer list. Keep the list in one place so every report uses the same definition.
Can I see which prompts sent the visit?
No. You get the landing page and, sometimes, the referrer, but not the conversation. To learn which questions you show up for, run a fixed list of buyer prompts through the AI tools every week and log who gets cited.
Why did my ChatGPT traffic suddenly drop to zero?
Check how you count it before assuming visits fell. A change in how links open can strip the referrer or the tag, and a report built on one signal will show a cliff. In our data, ChatGPT referrers fell from 28 sessions in August to 0 in October while tagged visits held steady.