Want to see how much traffic your website receives from ChatGPT, Gemini, Perplexity, and other AI platforms?

You can set up a custom report in Google Analytics 4 (GA4) using Free form exploration and a regex filter. This lets you identify AI-related traffic sources and see which pages receive visits from them.

Here's how to set it up step by step.

Step 1: Open Free Form Exploration

  1. Open your Google Analytics 4 property.
  2. Click Explore in the left-hand navigation.
  3. Select Free form.
  4. Name your exploration LLMS Visibility or AI Traffic Visibility.

You'll now see the Variables and Settings panels side-by-side.

Step 2: Add Dimensions

Under Variables โ†’ Dimensions, click the + icon and import these two dimensions:

  • Session source / medium
  • Page path + query string

These dimensions let you identify traffic sources and the page paths associated with them.

Step 3: Add Metrics

Under Variables โ†’ Metrics, click the + icon and import:

  • Entrances โ€” counts how often a page was the first page of a session.
  • Views โ€” counts page views, including repeat views.

Step 4: Configure the Rows

In the Settings panel, configure the Rows section as follows:

Setting Value
First row dimension Session source / medium
Second row dimension Page path + query string
Nested rows Yes
Show rows 250

This groups page paths neatly under their corresponding traffic sources.

Step 5: Configure Values

Scroll down to the Values section and drag or add:

  • Entrances
  • Views

Under Cell type, select Bar chart to display visual bars alongside the values.

Your report structure is now ready. Next, we'll filter it to show AI-related traffic.

Step 6: Add the AI Traffic Filter

Scroll down to Filters in the Settings panel and configure the filter as follows:

  • Dimension: Session source / medium
  • Condition: matches regex
  • Value: Copy and paste the expression below.
Regex Filter for AI Referrals
.*chatgpt.*|.*openai.*|.*neeva.*|.*writesonic.*|.*nimble.*|.*outrider.*|.*perplexity.*|.*edgeservices.*|.*gemini.*google.*|.*copilot.*|.*claude.*|.*mistral.*|.*meta.*|.*jasper.*|.*deepmind.*|.*copy.*ai.*

Click Apply.

That's it! GA4 will now display source/medium values matching at least one of the patterns in the regex.

What does this regex cover?

The expression matches source/medium values containing patterns associated with AI platforms and services, including:

  • ChatGPT and OpenAI
  • Perplexity
  • Gemini
  • Microsoft Copilot
  • Claude
  • Mistral
  • Jasper and Copy.ai
  • Other leading AI crawlers and referral surfaces
โš ๏ธ Starter filter note: This is a starter filter, not an exhaustive list of all AI platforms. Some patterns, such as .*meta.* and .*openai.*, can match unrelated sources. Review your actual GA4 source/medium values and refine the expression as your data grows.

Step 7: Review Your AI Traffic Report

Once you apply the filter, your table will show matching source/medium values, page paths, entrances, and views.

For example, you might see:

Session source / medium Page path Entrances Views
gemini.google.com / referral / 8 10
gemini.google.com / referral /openedx-ai-plugin 2 3
perplexity / (not set) /blog/ai-skill-gap-analysis 2 3

These are illustrative examples. Your actual results will depend on the data collected by your GA4 property.

๐Ÿ’ก Metric nuance: Page path + query string includes all pages viewed during matching sessions, not just initial landing pages. The Entrances metric helps you identify the specific page where sessions actually began.

Step 8: Select Your Date Range

In the Variables panel, click the date range and choose the period you want to analyze:

  • Last 28 days: For recent AI traffic and immediate spikes.
  • Last 3 months: For short-term trends and post-update shifts.
  • Last 12 months: For a broader overview of LLM citation growth over time.

Your report is now ready to help you monitor traffic attributed to AI-related sources.

Conclusion

With a few dimensions, two metrics, and a regex filter, you can create a custom GA4 Free form exploration to track AI-related referral traffic.

Save the exploration so you can return to it whenever you want to check which sources and pages are appearing in your AI traffic report.

As AI search engines and answer bots reshape how users discover information, measuring where AI referral traffic lands is the first step toward optimizing for LLM visibility.

Official reference: Google Analytics 4 Explorations Guide.