Today I want to show you how you can track traffic from AI sources in Google Analytics 4.
Getting Started
First, sign into Google Analytics and go to Reports. We're going to look at Traffic Acquisition.
When you're in here, the default view is going to show you all kinds of traffic sources like organic search and referral. We would like to see traffic from what I'll call organic AI. There are actually a couple of ways you can set this up, but this is the way that we found works the best. It gives you the most accurate data.
Creating Your Custom Report
Go over to the right and click Custom Report. Then we're going to go down and Add a Filter.
We're going to select the dimension and search for session source. Go ahead and select that.
Now we get to the match type. The match type I like to use is matches partial regex.
Setting Up the Regex Filter
Don't be scared of this. There are some characters we're going to use here that make it look complicated, but it's actually not all that complicated.
Here's where we start listing AI traffic sources like ChatGPT. The next one I want to list is Perplexity. But before I do that, I'm going to hold shift and press this vertical pipe character |. It might be a little hard to see, but it should be over by your delete key.
Now I can type in perplexity. I'm going to put in another vertical pipe. These pipes work like commas in regex.
The next AI traffic source is going to be Claude. Then I'll put another pipe. I'm going to finish with Gemini and Copilot from Microsoft.
The Complete Regex Filter
chatgpt|perplexity|claude|gemini|copilot
Now I've essentially got a list of AI traffic sources and I'm done. Go ahead and Apply this.
Verifying Your Data
I'm going to scroll down and just confirm that it's bringing in the right thing. This is very commonly what you're going to see: Unassigned traffic and Referral traffic. That's really the big one we want to see, because traffic from these AI sources should basically count as referral traffic. It's a referral from ChatGPT if they find you there and then they visit your site.
Adding Session Source Medium
Before we save this, there's something else we're going to do. Come over here to this little plus sign and we're going to add another column to this report.
Select session source medium. You'll see that this is going to add a little more information to our table that helps us see exactly where our traffic is coming from.
Saving Your Report
Now we can go up to Save and we're going to save this as a new report. You can call this whatever you want. I'm just going to name this Organic AI Traffic. Go ahead and save that.
Let's click Back to go back to our previous view.
Now that we've saved this, we don't have to keep building this every time we sign into Google Analytics. That's great. But what would be really great is if we could click over here and see it within this acquisition menu.
Adding the Report to Your Navigation
We've got the Traffic Acquisition report here, but there's no AI traffic view. It would be very convenient if we could have that, and we can.
All you have to do is go down here to Library. If you notice, this report is under the heading Life Cycle.
I go over here in my library and I just find that group right here: Life Cycle. Go ahead and click the three dot dropdown and hit Edit.
We're going to search for what we called the report, which was Organic AI Traffic. You can see it shows up right here.
What we'll do is grab this and just drag it over here. I like to put it under Traffic Acquisition. Let me scroll down so you can see that better. We're going to have our Life Cycle report, then our Traffic Acquisition, and then our Organic AI Traffic right underneath that.
Go ahead and Save it. This one I'm going to save changes to current collection. I don't want this to be a new collection.
Viewing Your AI Traffic Report
Let's go ahead and hit Back. Then let's go under Life Cycle > Acquisition. You can see right here: Organic AI Traffic.
Let me go ahead and click that. You can see here that my filtering is already on. If I scroll down, I can not only see what type of traffic it is, but I can also see exactly where it came from because I set up those two columns earlier.
Conclusion
This is a great thing to have in Google Analytics 4 so you can follow the story about the impact AI traffic is having on your overall traffic.