Tracking AI Traffic in GA4: A Step-by-Step Guide

Contents
    Add a header to begin generating the table of contents

    (post updated July 4, 2025)
    In this blog post, I’ll walk you through how to track and analyze AI-generated traffic in Google Analytics 4 (GA4). We’ll create a custom segment to identify AI sources, set up a new channel group, and visualize the data in both GA4 and Looker Studio. This process will help you understand the growing impact of AI platforms on your website traffic and lead generation.

    Why Track AI Traffic?

    As AI platforms like ChatGPT become more prevalent, they’re starting to show up as significant traffic sources for many websites. In GA for the Two Octobers website, I noticed ChatGPT appearing as a top traffic source, and we even received a qualified lead from someone who found us through the platform! By tracking AI traffic separately, you can:

    1. Understand the impact of AI on your overall traffic

    2. Measure the quality of AI-driven visits

    3. Adjust your content strategy to better serve AI platforms

    4. Compare AI traffic performance against other channels

    Let’s dive into the step-by-step process of setting this up in GA4. Watch the video or view the steps below.

    Step 1: Start an Exploration & Create an AI Traffic Segment

    First, let’s show AI traffic in an exploration.

    1. Open GA4 and click on Explore.
    2. Start a new blank exploration.
    3. Select Session Source/Medium as a dimension and Sessions as the metric. You can also add additional metrics like Engaged Sessions or Key Events to provide more context. 
    4. Under Segments, create a new custom segment, a Session segment.
    5. Name this segment “AI Sources” and add a condition: Session Source, Matches regex, and this value:
    .*(aitastic\.app|bnngpt\.com|chat-gpt\.org|chatgpt\.com|claude\.ai|copilot\.microsoft\.com|copy\.ai|edgepilot|edgeservices|gemini\.google\.com|iask\.ai|neeva|nimble\.ai|openai\.com|perplexity|writesonic\.com).*

    The AI landscape is evolving quickly, and new platforms are emerging all the time, so keep an eye on your traffic sources and adjust this regex pattern as new AI traffic sources appear. If you are not comfortable writing regex, ChatGPT and Claude are great helpers!

    A screenshot of the segment configuration popup.

    Click Save to property so you can use the segment again in the future. Then click Apply.

    The left panel on your exploration should look like this:

    A screenshot of the Exploration Variables panel.

    Step 2: Visualize AI Traffic Over Time

    To get an overview of AI traffic growth:

    1. In the exploration, change the Visualization to a line chart and select Session Source/Medium as the breakdown dimension. Add Sessions in the Values section.
    2. Set the Time Range to the last 90 days for a broader view.
    3. Adjust the Granularity from Day to Week for a clearer view of weekly changes in traffic.
    A screenshot of the exploration.

    Step 3: Creating an AI Traffic Channel Group

    For ongoing reporting, we’ll add AI traffic as a new channel group in GA4.

    1. In Admin, go to Channel groups under Data display.
    2. Click Create new channel group and name it “Custom channel group with AI” 
    3. Click on Add new channel. Name it “AI”. Set the channel conditions to Source, matches regex, and insert the same patterns from Larry Engel’s post. Save the channel.
    4. Click Reorder and move the “AI” group up in priority so it is assigned before Referral. Save the group.

    Step 4: View the AI Channel Group in the Traffic Acquisition Report

    New Channel groups start collecting data when you create them, so you’ll need to wait a bit. Once your new channel group has been collecting data for some time:

    1. Go to Reports > Acquisition > Traffic Acquisition.
    2. At the top of the data table, change to “Custom channel group with AI” (or whatever you named the new channel group you created) to see your new AI line item on the report.
    GA4 traffic acquisition with new AI channel group applied

    Step 5: Integrate with Looker Studio

    To use your new channel group in Looker Studio:

    1. Open your Looker Studio report.

    2. Go to your GA4 data source and click “Edit Connection”.

    3. Click “Refresh Fields” to update the available dimensions and metrics.

    4. You can now use the new channel group in your Looker Studio visualizations.

    Additional resources

    • Tracking AIO traffic – The method above works for AI platforms and tools, but it doesn’t work for AI overviews in Google search results. This article from Dana DiTomaso describes a crafty trick for doing that: How to Track Traffic from AI Overviews, Featured Snippets, or People Also Ask Results in Google Analytics 4
    • Tracking AI agents – A challenging issue with AI tools is the fact that a user might ask AI to gather information about your business without ever visiting your site. This triggers a bot visit, but Google Analytics filters out known bots and spiders. This LinkedIn post from Dan Hinkley describes how to analyze web server log files with Screaming Frog to see when ChatGPT visits your site in response to a specific user’s prompt.
    • How AI traffic performs – a question on a lot of people’s minds is how traffic from AI platforms performs in comparison to organic search traffic. I’ve seen a lot written about this, but most of what I’ve come across is anecdotal or opaque about methodology. This article from ahrefs is the most thorough I’ve found: AI Visitors Visit Fewer Pages and Bounce More Often Than Traditional Search Visitors.

    Subscribe
    Notify of
    guest

    6 Comments
    Oldest
    Newest Most Voted
    Inline Feedbacks
    View all comments
    Intis Kalnins
    Intis Kalnins
    10 days ago

    As a business that is trying to expand our AI-driven traffic this was really useful in getting our analytics aligned. Thanks.

    Luciano Borg
    Luciano Borg
    3 days ago

    Hi Nico,

    Thank you so much for this!
    I have two sources for ChatGPT: chatgpt.com / (not set) and chatgpt.com / referral.
    Any idea why this is happening please?

    Last edited 3 days ago by Luciano Borg
    Bowman Kelley
    Bowman Kelley
    1 day ago

    Extremely timely, clear and useful, Thanks

    Don't Miss a Beat

    Marketing analytics insights, delivered to you.

    Two monthly emails featuring our latest guides and discoveries.

    have you registered?

    Our next free digital marketing seminar is coming soon!

    [MEC id="946"]