How to Track AI Traffic in GA4 and Ahrefs Web Analytics (ChatGPT & More) | 4.1. AEO Course by Ahrefs
Chapters5
Overview of why measuring AI visibility is harder than traditional SEO and the three tracking approaches you’ll use.
Track AI-driven traffic with GA4 custom channels, Ahrefs Web Analytics, and self-reported attribution to measure AI visibility and impact on revenue.
Summary
Samo walks through three practical pillars for measuring AI visibility in the Ahrefs AI Search course: AI referral traffic, AI bot activity, and self-reported attribution. He emphasizes that traditional SEO metrics don’t always map neatly to AI search, so you’ll need to set up a few targeted systems. The first method uses GA4 to create a custom channel group labeled AI traffic and a regex that captures sources like chat.openai.com and claude.ai. The second method uses Ahrefs Web Analytics to monitor AI bot activity via a Cloudflare integration, helping you identify which pages bots repeatedly hit and which pages are strong citation candidates. The third method, self-reported attribution, involves asking users how they heard about you to connect AI exposure with actual conversions. Samo also cautions that many AI platforms don’t pass referral data consistently, so analytics will likely undercount AI traffic. He then shows how to combine these three pillars with brand radar tracking from module two for a fuller picture. The goal is to decide what to optimize (pages AI visitors land on, pages that aren’t receiving AI traffic, and how AI bots index your content) and to plan weekly/monthly workflows that demonstrate ROI in AEO. The module closes by promising a look at ROI and ongoing growth in the final lesson.
Key Takeaways
- GA4 can isolate AI traffic with a custom channel group and a regex including sources such as chat.openai.com, perplexity, and claude.ai to reveal how AI platforms guide visitors to your site.
- AI referral data is often incomplete or stripped on some platforms (e.g., in-content links on paid ChatGPT accounts lack referrer data), so expect undercounting of AI-driven visits.
- Ahrefs Web Analytics with Cloudflare integration provides a ready-made AI search channel and clearer separation of unknown vs. direct traffic, aiding quicker insights.
- Tracking AI bot activity (training bots vs. search/citation bots) helps identify which pages are most cited by AI and which pages aren’t discoverable enough.
- Self-reported attribution, collected via onboarding or post-purchase questions, directly links AI visibility to conversions and can reveal AI-driven revenue that analytics miss.
- An effective AI visibility strategy combines referral traffic, bot analytics, self-attribution, and brand radar for a complete picture of impact and ROI.
- Regularly updating pages that AI traffic lands on and fixing underperforming pages helps maintain and grow AI-driven visibility and conversions.
Who Is This For?
This is essential viewing for SEO teams and growth marketers using AI-driven search, especially those leveraging GA4 and Ahrefs Web Analytics to measure AI visibility and ROI.
Notable Quotes
"“Measuring AI visibility is a lot harder than measuring results from traditional SEO.”"
—Samo sets the stage by explaining the measurement challenge in AI search.
"“Use AI referral traffic to understand the general trend of which AI platforms are sending you customers and visitors.”"
—First pillar: how AI sources send users to your site.
"“If you want something simpler than GA4, Ahrefs has a free tool called web analytics that does this automatically.”"
—Introducing a bundled alternative to GA4 for AI traffic tracking.
"“There are two types of AI bots to know about.”"
—Summarizes training bots vs. search/citation bots and their roles.
"“Add that question to an entry survey. It’s the most direct way to connect AI visibility to actual business results.”"
—Highlights the importance of self-reported attribution for ROI.
Questions This Video Answers
- how do I track AI traffic in GA4 for my site
- what is AI referral traffic and why is it often undercounted
- how can Ahrefs Web Analytics help monitor AI bots visiting my site
- what is self-reported attribution and how does it show AI impact on conversions
- how to set up a GA4 custom channel group for AI traffic and why
GA4Ahrefs Web AnalyticsAI referral trafficAI bot analyticsSelf-reported attributionAI search optimizationAEO (Ahrefs AI Search)Channel groupsRegex in GA4Brand radar
Full Transcript
Hey, it's Samo and welcome to module four in Ahrefs AI search course. Now, in module three, we covered how to create content, earn mentions, and optimize YouTube videos to get mentioned and cited in AI search. And we also talked about how you can optimize for the technical side of AEO. So, now you've got a playbook for execution. But, here's the thing. None of that matters if you can't measure whether it's working. And that's what this module is all about. Now, I'll be upfront with you. Measuring AI visibility is a lot harder than measuring results from traditional SEO.
With SEO, you've got Google Search Console giving you impressions, clicks, and rankings. With AI search, a lot of that data either doesn't exist or is hidden from you. But, that doesn't mean you're flying blind because there are three ways to track your AI visibility. And in this lesson, I'm going to walk you through how to set each one up. Let's get started. So, the first thing you should track is AI referral traffic to your site. This is when someone clicks a link from ChatGPT, Perplexity, Claude, or another AI platform and lands on your site. In analytics tools like Google or Ahrefs Web Analytics, it'll show up as a referral visit.
This is helpful in knowing how many people are finding you because of AI. But, here's where it gets tricky. Not all AI platforms pass referral data properly. Some of them strip it out entirely, which means the visit shows up as direct traffic in GA4. And if it does that, then there's no real way to know that the traffic came from AI. For example, ChatGPT's source links in search results pass referral data properly. But, in-content links on paid accounts use a no-referrer attribute. So, those visits are actually invisible. Claude tracks properly. Perplexity tracks on the web, but not on its desktop app.
Copilot tracks on the web, but not on Windows. And Grok doesn't pass referral data at all. So, the key takeaway here is this. Use AI referral traffic to understand the general trend of which AI platforms are sending you customers and visitors. But understand that what you see in your analytics is likely an undercount. Now, with that caveat out of the way, let me show you how to set this up. If you're using GA4, you'll want to create a custom channel group that isolates AI traffic. Go to admin, then data display, then channel groups. Copy your default channel group and add a new channel called AI traffic.
Then set the source to match a regex that includes chat.openai.com, perplexity, gemini.google.com, copilot.microsoft.com, claude.ai, and deepseek.com. Once that's set up, go to reports, then acquisition, then traffic acquisition, and select your new channel group. Now you can see the traffic AI is sending you, the pages it's directing people to, and how those visitors behave compared to other channels. Now, if you want something simpler than GA4, Ahrefs has a free tool called web analytics that does this automatically. It has a built-in AI search channel, so you don't have to set up any custom groups. It also separates unknown traffic from direct traffic, which GA4 doesn't do.
That means you can get a clearer picture of where your traffic is actually coming from. All right, so once you've got AI traffic set up, there are two things I'd pay attention to. First, look at which pages are getting AI traffic. These are the pages AI is already recommending to users. Make sure you keep these up to date, keep them accurate, and have clear calls to action. If AI is sending people to a page that hasn't been updated in a year, it'll probably stop sooner than you'd like. And second, look at your important pages that aren't getting AI traffic.
If you've got a key product page or a high-value blog post that's getting zero AI referrals that should be getting it, that's worth investigating. It could be a content issue, a crawling issue, or it could just mean AI isn't surfacing that topic yet. The second thing to track is AI bot activity on your site. This one's a bit different. Instead of tracking the humans who click through from AI, you're tracking the AI bots themselves, the crawlers that visit your site to read and index your content. And here's something most people don't realize. AI bots visit your pages far more often than humans do.
So, the pages they're hitting the most are likely your strongest citation candidates. Now, there are two types of AI bots to know about. The first type is training bots like GPT bot and Google extended. These take your content and use it to train AI models. The second type is search and citation bots like ChatGPT user and OAI search bot. These fetch your pages in real time when a user asks a question. These are the ones that can actually drive referral traffic to your site. To track bot activity, you can use server logs if you have access to them, but the easier way is through Ahrefs bot analytics, which has a Cloudflare integration that shows you exactly which AI bots are visiting your site, how often, and which pages they're focusing on.
And this works with a free Cloudflare plan, too. Now, what you're looking for here are patterns. If a citation bot is hitting a specific page repeatedly, that page is likely being used as a source in AI responses. And if there are important pages that bots aren't visiting at all, that could mean they're hard to discover, which ties back to the internal linking and site structure we talked about in module three. All right, the third thing to track is self-reported attribution. This one's the simplest to explain, but it might be the most important for proving the value of AEO to your team and to your clients.
You see, a lot of the impact of AI visibility doesn't show up in your analytics at all. Someone asks ChatGPT for a recommendation, they get your brand name, then they go to the browser bar, and they type it directly in there. That shows up as direct traffic. Or, they Google your brand name after hearing about you from AI. That's going to show up as organic search traffic. So, the only way to capture this is to ask people directly. Add a "How did you hear about us?" question to your sign-up flow, your checkout process, or your post-purchase survey.
Include options like AI assistant, ChatGPT, Perplexity, etc. And AI search, like Google AI overviews. At Ahrefs, around 3% of our conversions came from AI over the last year, based on self-reported data. And our AI visitors convert at a much higher rate than organic search visitors. But, we would never have known that without asking. So, if you only do one thing from this lesson, add that question to an entry survey. It's the most direct way to connect AI visibility to actual business results. Now, these three pillars work best when you use them together. Referral traffic tells you what AI is sending to your site.
Bot analytics tell you what content AI is paying attention to. And self-attribution tells you what's actually driving revenue. No single source gives you the full picture. But, together, they give you a pretty clear view of how AI is interacting with your brand and where you should focus your efforts. And on top of these three pillars, you've still got brand radar tracking your AI visibility across platforms, which is what I showed you how to do back in module two. So, now that you've got your analytics set up, the big question is, is all of this actually worth it?
What's the ROI of AEO? And what should you actually be doing on a weekly and monthly basis to keep growing your AI visibility? That's what we'll cover in the next and final lesson. I'll see you there.
More from Ahrefs
Get daily recaps from
Ahrefs
AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.









