How to Track AI Referral Traffic from ChatGPT and Perplexity
AI assistants like ChatGPT, Perplexity and Gemini now link to sources, but by default GA4 mixes those visits into generic Referral traffic, so they are easy to miss. In this guide you will make sure analytics is installed, create an AI Assistants channel and segment in GA4, connect GA4 to the audit, and confirm that AI sessions show up in the last 28 days.

Why it matters
Without a dedicated AI channel you cannot tell whether your GEO work, such as structured data, clear answers and llms.txt, is earning citations that send visitors. Tracking AI referrals shows which pages AI assistants recommend, how those visitors convert compared with organic search, and whether a drop in Google clicks is being offset by AI traffic. It also gives you a baseline, so you can report AI visibility with numbers instead of guesses.
What you need
Step-by-step fix
Confirm an analytics tag is installed
Open your homepage, press F12 and go to the Network tab. Reload the page and filter for collect or gtag. com/g/collect`, GA4 is running.
If you see nothing, install the GA4 tag in the <head> of every page. Replace G-XXXXXXXXXX with the Measurement ID from Admin > Data collection and modification > Data streams > Web.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>Check that referrers are not being stripped
AI traffic is identified by the referrer or by utm_source. A Referrer-Policy: no-referrer header does not affect what other sites send you. com`, which ChatGPT appends to many links.
com` and confirm the final URL still contains the parameter.
curl -sIL "http://example.com/?utm_source=chatgpt.com" | grep -i "^location"
Create an AI Assistants custom channel group
In GA4 go to Admin > Data display > Channel groups > Create new channel group. Name it Channels with AI, which starts as a copy of the Default Channel Group. Click Add new channel and name it AI Assistants.
Add the condition Source · matches regex and paste the pattern below. Save the channel, then use Reorder to drag it above Referral, because GA4 assigns each session to the first matching channel.
^(.*\.)?(chatgpt\.com|chat\.openai\.com|openai\.com|perplexity\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|claude\.ai|chat\.mistral\.ai|you\.com|phind\.com|meta\.ai|grok\.com|chat\.deepseek\.com)$
Build a reusable AI referral segment
Go to Explore > Free form > Segments > + > Session segment. Name it AI referrals. Add the condition Session source · matches regex and use the same pattern as in the previous step.
Then set the rows to Landing page + query string and the values to Sessions, Engaged sessions and Key events. This shows which pages AI assistants send people to.
Add AI traffic to the standard acquisition report
Open Reports > Acquisition > Traffic acquisition. Click the primary dimension dropdown and choose Channels with AI (or Session custom channel group) so 'AI Assistants' appears as its own row. Click the pencil icon, then Save changes to current report, so the whole team sees AI as a channel by default.
Connect GA4 to the audit
In the audit tool, open Integrations > Google Analytics 4 and sign in with a Google account that has at least Viewer access to the property. com. The audit reads session sources for the last 28 days and counts visits from AI assistants.
Without this connection, it can only detect that an analytics script exists.
Verify AI sessions are being recorded
In GA4, set the date range to Last 28 days in the Traffic acquisition report and confirm the AI Assistants row has sessions. For a live test, ask ChatGPT or Perplexity a question your site answers, click the cited link to example.com, and then watch Reports > Realtime for a session with source chatgpt.com or perplexity.ai. Finally, re-run the audit to confirm the check passes and lists your top AI sources.
Platform-specific notes
WordPress
Install Google's Site Kit plugin (Site Kit > Settings > Connect more services > Analytics), or paste the gtag snippet using a header plugin such as WPCode. Do not run Site Kit and a manual snippet together. Channel groups are still configured inside GA4.
Shopify
Connect GA4 through the Google & YouTube app (Settings > Apps > Google & YouTube > Google Analytics). Checkout events then flow through Shopify's Customer Events. Avoid also pasting gtag.js into theme.liquid, because that duplicates page views.
Next.js
Use the `GoogleAnalytics` component from `@next/third-parties/google` in your root `app/layout.tsx` with `gaId="G-XXXXXXXXXX"`. In App Router apps, enable enhanced measurement's 'Page changes based on browser history events' so client-side navigations are counted.
Wix / Squarespace
Wix: Marketing & SEO > Marketing Integrations > Google Analytics. Squarespace: Settings > Developer Tools > External API Keys > Google Analytics. Both inject the tag site-wide. Then create the AI channel group in GA4 itself.
Plausible / Matomo / PostHog
These tools can segment AI referrers too. In Plausible, filter Sources by the same regex. In Matomo, use Acquisition > Websites with a segment on referrerUrl. However, the audit only measures actual AI sessions through a GA4 connection, so with these tools alone it reports analytics as present but unmeasured.
Check that it worked
✅ How to verify
- GA4 > Reports > Acquisition > Traffic acquisition, with Channels with AI as the dimension and the date range set to Last 28 days, shows an 'AI Assistants' row with sessions above zero.
- GA4 > Reports > Realtime shows a session with source chatgpt.com or perplexity.ai after you click a cited link to your site from that assistant.
- Explore > Free form with the 'AI referrals' segment applied lists landing pages and sources such as gemini.google.com.
- Re-running the audit returns a pass that lists your AI sources and their session counts.
⚠️ Common mistakes
- Placing the AI Assistants channel below Referral in the channel group, so every AI visit is still counted as Referral.
- Using 'contains chatgpt' instead of an anchored regex, which also matches unrelated domains, or forgetting chat.openai.com and copilot.microsoft.com.
- Installing the analytics tool but never connecting GA4 in Integrations, which leaves the check on a warning even though the data exists.
- Redirects that drop query strings, which strip utm_source=chatgpt.com and push AI visits into Direct.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
Why does ChatGPT traffic show up as Direct in GA4?
Some AI apps, especially mobile and desktop apps, open links without sending a referrer. If the link also lacks utm_source, or a redirect strips it, GA4 records the visit as Direct. Web versions of ChatGPT usually add utm_source=chatgpt.com, so preserving query strings through redirects recovers much of this traffic.
What is the regex for AI traffic in GA4?
A practical pattern for Session source is ^(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai|meta\.ai|grok\.com|chat\.deepseek\.com)$. Review your Referral sources every few months and add new assistants as they appear.
Does Google AI Overviews traffic show up as AI referral?
No. Clicks from AI Overviews and AI Mode come from google.com and are reported as Organic Search in GA4, with no separate referrer. Use Search Console's Performance report to monitor them. The AI Assistants channel covers standalone tools such as ChatGPT, Perplexity, Gemini and Copilot.
How much AI referral traffic is normal?
For most sites it is still a small share of total sessions, often well under a few percent, but it tends to be highly engaged. The trend matters more than the absolute number, so compare the AI Assistants channel month over month and look at which landing pages are cited.
How to Fix Brand + Category Co-occurrence for AI Search
How to Verify Your Site in Bing Webmaster Tools
How to Fix Passage-Level Content Chunking for AI Answers
How to Add Captions and Transcripts to Images and Video
How to Fix Missing Outbound Citations in Your Content
How to Add Expert Quotes and a Unique POV for AI Citations