TechBuzzPro

GA4 AI Referral Channel: Track ChatGPT, Claude & Perplexity

· 4 min read · AI Tools

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can build a GA4 AI referral channel to see exactly how much traffic ChatGPT, Claude, and Perplexity send to your site. This works by creating a custom channel grouping that recognizes AI platform referrers, so your reports separate AI traffic from organic search or direct visits. You'll need GA4 Edit access and a Google Analytics 4 property already set up.

What You'll Need

  • GA4 property with Edit access (Admin > Property > Property Access Management)
  • A list of AI platform domains (see step 3)
  • Familiarity with GA4's channel grouping interface

Step-by-Step

  1. Open the channel grouping editor. In GA4, go to Admin > Data Display > Channel groupings. Click the pencil icon next to "Default Channel Grouping" to create a new version, or click "Create new channel grouping" to make a custom one.
  2. Add a new channel rule. In the editor, click "Add new channel" and name it something like "AI Referral". This is the label that will appear in your reports.
  3. Define the rule conditions. For the new channel, add a condition: Session source matches regex. Use this regex pattern to cover major AI platforms:
    (chatgpt\.com|openai\.com|claude\.ai|anthropic\.com|perplexity\.ai|poe\.com|you\.com|gemini\.google\.com)
    This captures both the chat interface and the company domains that may appear as referrers.
  4. Save the channel grouping. Click "Save" and then "Apply" to make it active. If you edited the default grouping, you'll be asked to name the new version (e.g., "Default with AI").
  5. Verify in reports. Go to Reports > Acquisition > Traffic Acquisition. Add a secondary dimension of "Session source" and look for your new "AI Referral" channel. You may need to adjust the date range to include traffic after you applied the grouping.
  6. Create a custom report (optional). Go to Explore, create a new Free Form report. Set rows to "Session source" and values to "Sessions". Add a filter for "Session channel" containing "AI Referral" to see which specific AI platform sent traffic.

Common Mistakes

  • Using "Session source" instead of "Session source/medium" – The regex matches the full source string, so if you use the combined field, your pattern may not match. Stick to Session source alone.
  • Forgetting to apply the grouping – You must click "Apply" after saving, otherwise the old grouping stays active.
  • Not including all AI domains – Users may come from chat.openai.com or claude.ai, not just the main domain. The regex above covers common variants, but add more if you see others in your data.
  • Expecting historical data – Channel groupings apply retroactively to data after the grouping is created, but not before. If you apply it today, you won't see AI traffic from last month.

Tips

  • Add the AI referral channel to your default grouping so it appears in all standard reports, not just custom ones.
  • Use UTM parameters on links you share to AI platforms – this gives you cleaner data and lets you track campaigns separately.
  • Check your AI referral traffic weekly to spot new platforms that might be sending visitors; add them to your regex.
  • Combine this with a custom alert: set up an alert for when AI referral sessions spike, so you know when a post goes viral on ChatGPT.

Troubleshooting

If AI traffic doesn't appear:

  1. Check that you applied the grouping correctly – go back to Admin > Channel groupings and confirm the active version is the one you edited.
  2. Verify that the referrer is actually from an AI platform. Use the DebugView in GA4 to see real-time events and check the source parameter.
  3. Test the regex in a regex tester with a sample source like "chatgpt.com" – if it doesn't match, adjust the pattern.
  4. Ensure you're looking at the right date range. AI traffic may be low, so expand to 90 days.

If the channel doesn't show in reports:

Go to Reports > Library, find the Traffic Acquisition report, and check if it's using the default channel grouping. If it's a custom report, you may need to edit it to include the new channel.

Frequently Asked Questions

Will this work for all AI chatbots?

It covers the major ones (ChatGPT, Claude, Perplexity, Gemini, Poe). If a new AI platform appears, add its domain to the regex.

Do I need to add a separate channel for each AI tool?

No, the regex groups them all under one channel. You can still see individual sources by adding "Session source" as a secondary dimension.

Why don't I see AI traffic from incognito or logged-out users?

GA4 still tracks those sessions, but if the user has ad blockers or privacy extensions, the referrer may be stripped. That's a limitation of client-side tracking.

Can I track AI traffic in real-time?

Yes, in the Realtime report, you can filter by channel and see sessions as they happen. Note that the channel grouping may take a few minutes to apply.

Does this affect my existing channel groupings?

If you edit the default grouping, it creates a new version. You can switch back anytime by going to Admin > Channel groupings and selecting the original.

What if I see traffic from "bard.google.com" or other AI domains?

Add those domains to your regex. The pattern is easy to extend – just add a pipe and the domain.