How to Track AI Traffic in GA4: Google Analytics 4 vs Matomo for Measuring AI Referral Traffic

Track AI traffic as referral traffic first, then separate it with custom rules in GA4 or Matomo. GA4 can identify visits from domains such as chatgpt.com, perplexity.ai, copilot.microsoft.com, and gemini.google.com when a referrer is passed. Google defines source and medium as the values used to identify where traffic comes from in Analytics reports [source: Google]. That makes AI referral tracking possible, but not perfect, because many AI apps and mobile browsers strip referral data.

What counts as AI referral traffic?

AI referral traffic is any visit sent from an AI assistant, AI search engine, chatbot interface, or answer engine to your website. Common sources include:

  • chatgpt.com and chat.openai.com
  • perplexity.ai
  • copilot.microsoft.com and bing.com/chat
  • gemini.google.com
  • claude.ai
  • poe.com
  • you.com

The catch is that AI traffic is messy. Some tools pass a clean referrer. Some pass nothing. Some open links inside an app or a privacy-heavy browser view, which can make the session look like Direct. So your report is not “all AI traffic.” It is the AI traffic that your analytics platform can see.

How to track AI traffic in GA4

GA4 does not currently give you a perfect built-in report called “AI traffic.” You need to build one. The basic method is simple: filter referrals by AI domains, then save the view for repeat use.

  1. Open Reports in GA4.
  2. Go to Acquisition, then Traffic acquisition.
  3. Set the primary dimension to Session source / medium or Session source.
  4. Search for AI domains such as chatgpt, perplexity, copilot, gemini, and claude.
  5. Compare sessions, engaged sessions, key events, and revenue.

For a cleaner view, create a custom report or Exploration using a regex filter. A practical regex may look like this:

chatgpt|openai|perplexity|copilot|gemini|claude|poe|you

Be careful with broad terms like you. It can match unrelated sources. A stricter version is usually safer:

chatgpt\.com|chat\.openai\.com|perplexity\.ai|copilot\.microsoft\.com|gemini\.google\.com|claude\.ai|poe\.com|you\.com

If you use GA4 events well, you can measure more than sessions. Track form submits, signups, trials, purchases, scroll depth, and lead quality. AI traffic often arrives with strong intent. A visitor may ask an assistant for “best accounting software for contractors,” then click one cited result. That click can be small in volume but high in value.

Custom channel groups in GA4

A better setup is a custom channel group named “AI Referrals.” Add rules where the source matches known AI domains. Then your reports can show AI traffic next to Organic Search, Paid Search, Referral, Email, and Direct.

It drives me crazy that this takes more clicks than it should. A simple task can turn into a five-minute hunt through admin settings. Still, once the group is set, reporting becomes much easier.

Use these checks:

  • Landing pages: Which pages do AI tools cite or recommend?
  • Engagement: Do AI visitors stay longer than organic visitors?
  • Conversions: Do they submit forms, buy, or request demos?
  • Queries by proxy: Which page topics attract AI referrals?
  • Assisted impact: Do users return later through direct or branded search?

How Matomo tracks AI referral traffic

Matomo handles AI traffic through its Referrers reports, segments, and custom reports. It is more transparent than GA4 in some setups because you can inspect visitor logs, raw referrer URLs, and individual journeys if your configuration allows it.

To track AI referrals in Matomo:

  1. Go to Acquisition, then Referrers.
  2. Review websites sending traffic.
  3. Create a segment where Referrer URL or Referrer Name contains AI domains.
  4. Save the segment as “AI Referrals.”
  5. Apply it to goals, ecommerce, content reports, and visitor logs.

Matomo is useful if your organization cares about data ownership. You can host it yourself, keep analytics data on your own server, and adjust retention policies. Matomo also documents privacy-focused analytics options, including cookieless tracking configurations [source: Matomo].

GA4 vs Matomo for AI traffic measurement

Area GA4 Matomo
Setup speed Fast if GA4 is already installed Fast for basic referrer reports, slower for self-hosting
AI source grouping Requires custom channel groups or Explorations Requires segments or custom reports
Raw data access Limited unless using BigQuery export Stronger, especially with self-hosted setups
Privacy control Good controls, but Google-hosted Stronger control for self-hosted teams
Attribution Good for event and conversion analysis Clear visitor-level paths when configured

GA4 is the practical choice for teams already invested in Google Ads, Looker Studio, BigQuery, and standard marketing dashboards. Matomo is the better fit when privacy, data control, and raw referral visibility matter more than integration with Google products.

What GA4 and Matomo both miss

Both tools miss hidden AI influence. This matters. If someone reads an answer in ChatGPT, remembers your brand, and types your URL later, that session will likely appear as Direct. If an AI assistant summarizes your article without a click, there is no visit to track at all.

Expect gaps such as:

  • No referrer: The AI app strips the source.
  • App browsers: Traffic appears as direct or generic mobile traffic.
  • Copied links: Users paste URLs manually.
  • Brand searches: AI causes awareness, but Google Search gets the session.
  • Zero-click answers: The user gets the answer and never visits.

This is why AI referral tracking should be paired with other signals. Watch branded search volume, direct traffic to cited pages, demo form notes, sales call feedback, and rank visibility inside AI answer tools.

A practical reporting model

Use a simple monthly report. Do not overbuild it at first.

  • AI sessions: Total sessions from known AI sources.
  • Top AI sources: ChatGPT, Perplexity, Copilot, Gemini, Claude.
  • Top landing pages: Pages most often cited or clicked.
  • Engagement rate: Compare against organic search and referral traffic.
  • Conversions: Leads, trials, purchases, demo bookings.
  • Conversion rate: AI conversion rate versus site average.
  • Revenue or pipeline: Add CRM data when possible.

For example, a SaaS company might report 1,200 AI referral sessions in April. ChatGPT sends 620 sessions, Perplexity sends 410, and Copilot sends 170. The traffic produces 52 trial starts, a 4.3% trial rate. If the site average is 2.1%, AI referrals deserve serious attention even if they represent only 3% of total sessions.

Best recommendation

Use GA4 if you need speed and shared marketing reporting. Build an AI Referral channel group, track key events, and review landing pages every month. Use Matomo if you need ownership, privacy control, and clearer access to referrer details. For many serious teams, the best answer is both: GA4 for marketing dashboards and Matomo for audit-level visibility.

The main rule is simple. Do not wait for a perfect AI analytics report. Start with visible referrals, label them clearly, and compare them against conversions. The data will be incomplete, but it will still show which AI tools are sending visitors who matter.