How to Track AI Referral Traffic in GA4: GA4 vs Matomo for Measuring AI Search Traffic

October 15, 2026
Written By Digital Crafter Team

 

Track AI referral traffic with a controlled source list, custom channel rules, and weekly validation. In GA4, start by isolating AI referrers such as chat.openai.com, perplexity.ai, copilot.microsoft.com, gemini.google.com, and claude.ai. GA4 reports acquisition through traffic-source dimensions such as source, medium, and campaign [source: Google]. That makes it usable for AI traffic, but not automatic or clean out of the box.

TLDR: GA4 can track AI referral traffic, but you need custom reports and often custom channel grouping to see it clearly. Matomo gives more control, especially if you care about raw referrer URLs, privacy, and keeping data in your own environment. For example, a B2B site with 18,000 monthly sessions might find only 94 sessions from AI tools in GA4, but Matomo may show 127 because it exposes more referrer detail and fewer rows are hidden in reports. Use GA4 for marketing reporting, but use Matomo when you need stricter audit trails.

What Counts as AI Referral Traffic?

AI referral traffic means visits that arrive after someone clicks a link shown by an AI assistant or AI search product. This can include ChatGPT, Perplexity, Microsoft Copilot, Gemini, Claude, You.com, or AI summaries inside search products.

Do not mix this with AI crawler traffic. A bot fetching your pages for training or indexing is not the same as a buyer clicking through from an AI answer. One is server activity. The other is a user session. Your reporting should separate them.

How to Track AI Referrals in GA4

GA4 will usually classify AI visits as Referral, if a referrer is passed. That “if” matters. Some apps remove referrer data. Some open links in embedded browsers. Some traffic may appear as Direct. It drives me crazy that one privacy setting or app behavior can erase the source after you did everything else right.

Start with this process:

  1. Open GA4 and go to Reports > Acquisition > Traffic acquisition.
  2. Change the main dimension to Session source / medium.
  3. Search for known AI referrers, such as chatgpt, openai, perplexity, copilot, gemini, claude, and you.com.
  4. Add a comparison where Session source matches a regex pattern for AI sources.
  5. Save the report or add it to a custom collection.

A starter regex might look like this:

chatgpt|openai|perplexity|copilot|gemini|claude|you\.com|phind|poe

Keep it reviewed. AI products change domains. Some send traffic from subdomains. Some send nothing useful at all.

Build a Custom AI Channel in GA4

If you only search source reports, you will miss patterns. A better setup is a custom channel group for AI referrals. In GA4 Admin, open Data display > Channel groups, then create a channel called AI Referral.

Use rules like:

  • Source matches regex: chatgpt|openai|perplexity|copilot|gemini|claude|you.com
  • Medium exactly matches: referral
  • Optional: landing page contains high-intent content paths, such as /pricing, /demo, or /comparison

This removes some noise and helps executives understand the data. “AI Referral” is clearer than a row called chat.openai.com / referral buried under 80 other referrers.

Use Explorations for Better GA4 Analysis

GA4 standard reports are fine for quick checks. For serious analysis, use Explore. Create a free-form exploration with these dimensions:

  • Session source
  • Session medium
  • Landing page + query string
  • Device category
  • Country

Then add metrics such as:

  • Sessions
  • Engaged sessions
  • Key events
  • Total revenue
  • Average engagement time

This tells you whether AI visitors are useful or just curious. A SaaS company may see 320 AI sessions in one month and only 2 demo requests. Another may see 80 AI sessions and 9 signups. Volume alone is weak. Intent matters.

Where GA4 Falls Short

GA4 has real strengths. It connects well with Google Ads, BigQuery, Looker Studio, and broader marketing dashboards. But AI referral tracking exposes several weak spots.

  • Referrer loss: AI apps may strip referrer data, which makes traffic appear as Direct.
  • Sampling and thresholds: Some reports may hide detail, especially with small numbers or privacy controls.
  • Messy source names: Similar AI tools can appear under different domains.
  • Limited raw detail: You do not get the same log-level comfort that technical teams often want.

Honestly, it feels like GA4 makes you take five extra clicks to answer a simple question: “Did ChatGPT send us buyers?” The answer is there, but it is rarely sitting in the default report.

How Matomo Tracks AI Search Traffic

Matomo can track AI referrals in a more direct way. It records referrers, campaigns, goals, ecommerce activity, and visitor behavior. If you self-host it, you also keep more control over raw data retention and processing rules.

For AI traffic, Matomo is useful because you can inspect referrer details and create segments around known AI domains. You can build a segment for visitors where the referrer contains perplexity, chatgpt, copilot, or claude. You can then compare those visitors against organic search, paid search, and direct traffic.

Matomo also supports campaign parameters, goals, ecommerce tracking, and custom dimensions [source: Matomo]. That helps when you place links in owned AI surfaces, partner prompts, internal assistants, or documentation that may be reused in AI answers.

GA4 vs Matomo: Which Is Better?

Area GA4 Matomo
Ease of setup Fast if GA4 is already installed Moderate, especially if self-hosted
AI referral visibility Good with custom reports Strong with segments and referrer detail
Privacy control Limited by Google’s platform rules High, especially on your own server
Marketing ecosystem Excellent for Google Ads and Looker Studio Good, but less native to Google media
Raw data comfort Best with BigQuery export Better for direct ownership

If your team already uses GA4 for board reporting, keep it. Add an AI channel and clean exploration reports. If your legal, security, or analytics team needs tighter ownership, add Matomo in parallel.

Use UTM Tags Where You Can

You cannot control how ChatGPT or Perplexity cites your public pages. But you can control links you place in your own AI tools, custom GPTs, help bots, email prompts, and sales enablement content. Add UTM tags to those links.

Example:

?utm_source=custom_gpt&utm_medium=ai_assistant&utm_campaign=product_research

This gives GA4 and Matomo a clean signal. It also separates owned AI experiences from third-party AI referrals.

Recommended Reporting Setup

Use a simple weekly dashboard. Include these numbers:

  • AI referral sessions
  • AI referral conversion rate
  • Top landing pages from AI tools
  • Revenue or pipeline from AI referrals
  • Direct traffic lift on pages cited by AI tools

The last metric matters. Many AI tools do not always pass referral data. If a page starts appearing in AI answers, you may see direct traffic rise even when referral rows stay flat.

Practical Recommendation

Use GA4 as your main marketing source of truth, and use Matomo when you need deeper proof. GA4 is enough for trend reporting, campaign review, and leadership dashboards. Matomo is better for teams that need ownership, referrer inspection, and fewer black boxes.

The smartest setup is not GA4 or Matomo. It is GA4 plus disciplined naming, AI source lists, UTM rules, and periodic checks against Matomo or server logs. AI traffic is still small for many sites, but it can punch above its weight. A few high-intent visits from Perplexity or ChatGPT can be worth more than hundreds of low-quality search clicks.

Treat AI referral tracking as an attribution quality project, not a vanity report. Keep the source list current. Review landing pages. Tie visits to leads and revenue. That is how you turn vague AI visibility into data your team can trust.