AI assistants now send real visitors to your site — and they convert unusually well — but Google Analytics 4 lumps most of them into “Referral” or “Direct,” so you can’t see them. Here’s a copy-paste regex that matches the major AI engines, and the exact steps to build an AI-traffic view in GA4.
In GA4, AI traffic arrives as referrals from the assistants’ own domains (chatgpt.com, perplexity.ai, gemini.google.com, claude.ai, copilot.microsoft.com). Group them with one regex on “Session source” — either as a filter in a Free-form Exploration (fastest) or as a rule in a custom channel group (permanent). Copy the regex below.
Use this on the “Session source” dimension (RE2 / “matches regex”). It covers the major AI assistants and their alternate domains:
chatgpt\.com|chat\.openai\.com|openai\.com|perplexity\.ai|gemini\.google\.com|bard\.google\.com|claude\.ai|copilot\.microsoft\.com|edgeservices\.bing\.com|bing\.com/chatSee it in two minutes without changing your setup:
To make “AI” appear automatically in your standard reports: Admin → Data display → Channel groups → Create new channel group. Add a channel named “AI Assistants” with the condition “Session source matches regex” and paste the regex. Order it above “Referral” and “Organic Search” so AI visits are claimed by the AI channel first. New data is grouped going forward (it isn’t retroactive).
Two honest limitations. First, some AI apps and native/mobile clients don’t pass a referrer, so those visits land in “Direct” and this regex can’t catch them — your true AI traffic is higher than what you’ll see. Second, engine domains change and new assistants launch, so revisit the regex periodically. Treat the number as a directional floor that’s still far better than not measuring at all.
GA4 shows AI traffic that already arrived. To grow it, you also need to know whether AI engines mention and cite you in the first place — the prompts you win, the ones you lose, and to whom. That’s AI-visibility tracking (GEO), which GA4 doesn’t do; Beacon does, and pairs it with the SEO audit behind it.
Group visits from AI assistant domains using a regex on “Session source.” Add it as a filter in a Free-form Exploration for a quick view, or as a custom channel group to see “AI” in every report. Copy the regex in this guide.
Match “Session source” against: chatgpt.com, chat.openai.com, openai.com, perplexity.ai, gemini.google.com, bard.google.com, claude.ai, copilot.microsoft.com (and bing chat). The full copy-paste regex is above.
Some AI apps and mobile/native clients don’t send a referrer, so those visits are attributed to “Direct” and can’t be matched by source. That’s why regex-based AI traffic is a floor — your real AI traffic is higher.
No — GA4 only measures traffic that already arrived. Whether ChatGPT, Gemini or Perplexity actually mention and cite your brand for buyer prompts is AI-visibility (GEO) tracking, which is a separate tool like Beacon.
See which prompts ChatGPT, Gemini & Perplexity cite you for — free.