With the growing use of AI chatbots like ChatGPT, Bard, Claude, and others, it’s important to understand how much traffic they bring to your website. If you want to track visits from these AI tools to your site, you can set up a custom exploration in Google Analytics 4 (GA4) to get this data.
Step-by-Step Guide to Setting Up AI Chatbot Traffic Tracking in GA4
- Open Google Analytics 4
Log into your GA4 account and head to the “Explore” section in the left-hand menu. - Create a New Exploration
Click on “Blank” to start a new exploration. This will open up a custom exploration screen where you can choose the dimensions and metrics you want to analyze. - Add the “Page Referrer” Dimension and “Sessions” Metric
In the Variables panel on the left, click on “+” next to “Dimensions” and add the “Page referrer” dimension. Then, click on the “+” next to “Metrics” and select “Sessions.” - Apply the Regex Filter to Track Chatbot Referrals
To filter traffic specifically coming from AI chatbots, apply a regex (regular expression) filter.
Click on the “Filters” section, choose “Page referrer” as the dimension, and apply the following regex pattern:
^https:\/\/(www\.meta\.ai|www\.perplexity\.ai|chat\.openai\.com|claude\.ai|chat\.mistral\.ai|gemini\.google\.com|bard\.google\.com|chatgpt\.com|copilot\.microsoft\.com)(\/.*)?$
This regex checks for traffic from various AI chatbots, such as Meta, Perplexity, OpenAI’s ChatGPT, Anthropic’s Claude, Mistral, Gemini, Bard, and Microsoft Copilot.
Once you’ve applied the filter, the exploration will show you the number of sessions from these AI chatbots to your site. You can also modify the visualization type to get a clearer view of the data.
I’ve also uploaded a step-by-step video tutorial to visually guide you through the process. Feel free to check it out to see exactly how to set up this exploration in GA4.
By tracking traffic from AI chatbots, you can better understand your site’s audience and tailor your content accordingly.