Measure AI traffic in Matomo – Guide

Matomo AnalyticsAI TrafficGEOMatomo SegmentChatGPTPerplexityData Protection

ChatGPT, Claude, Perplexity – they send visitors to websites. In Matomo, this traffic ends up in the “Referral” channel, unsorted and invisible. This guide shows three ways to cleanly capture, analyze and continuously monitor AI traffic in Matomo – without external tools, in a privacy-compliant way and with historical data.

1. Matomo vs. GA4: what is different?

Anyone familiar with the GA4 guide will notice one key difference: Matomo does not have custom channel groups. GA4 solves the problem through a rule set that classifies future traffic. Matomo takes a different approach, and in some respects a more elegant one.

Google Analytics 4

Custom channel group with regex. Applies only to future sessions. Historical data remains uncategorized. Max. 2 groups per property.

Matomo Advantage

Segments with regex. Apply retroactively to all stored raw data. Unlimited segments. No limit per website.

Privacy bonus: Matomo runs on your own server, with no data sharing with Google. For companies with strict GDPR requirements, this is a significant advantage over GA4.

2. Why measure AI traffic separately?

AI systems are the new discovery layer: they read content, evaluate sources and provide concrete recommendations. If your site appears as a reliable source in ChatGPT or Perplexity, you get traffic. If it is not mentioned, you do not exist for a growing share of users.

In Matomo, this traffic – just like in GA4 – ends up in the “Referral” channel, mixed together with newsletter clicks, partner links and spam. The result: you cannot see whether AI systems are sending relevant visitors, which pages benefit from it and how well these users convert.

Important note: Matomo – just like GA4 – only captures clicks on links inside AI answers. Impressions (mentions without clicks) cannot be measured. Specialized tools such as Peec.ai or Semrush are needed for that.

3. Method 1: Create a segment (recommended)

Segments are the fastest and most flexible solution. They apply retroactively, are available in every report and can be adjusted at any time – without data loss.

Visitors Segments + Add new segment
  1. Click the segment selector at the top (dropdown next to the calendar).
  2. Select + Add segment → the segment editor opens.
  3. Name the segment: AI Traffic.
  4. Under “Conditions”, click + Add condition.
  5. Select the dimension: Referrer URL (under “Visits”).
  6. Operator: matches regular expression.
  7. Value: paste in the regex from section 4.
  8. Click Save. Matomo calculates the segment retroactively – depending on the amount of data, this may take a few minutes.
Adjust visibility: When saving the segment, enable the option “Visible to all users of this website” – otherwise the segment is only visible to your own account, not to colleagues or clients.
Ready to use immediately: Once saved, the segment is available in every Matomo report as a filter – Pages, Referrers, Goals, Time on site, E-Commerce. No further configuration step is required.

4. The AI regex: complete list of all sources

This regex covers all relevant AI platforms: ChatGPT, Claude, Gemini, Perplexity, DeepSeek, Microsoft Copilot, Grok, Mistral, Hugging Face and more than 80 other sources. It is identical to the GA4 version and can be used directly in Matomo.

Complete regex – paste into Matomo under “Referrer URL matches regular expression”
chatgpt\.com|chat\.openai\.com|gemini\.google\.com|deepseek\.com|perplexity(?:\.ai)?|claude\.ai|copilot\.microsoft\.com|deepl\.com|character\.ai|(?:\w+\.)?meta\.ai|grok\.x\.com|grok\.com|x\.ai|bard\.google\.com|(?:\w+\.)?mistral\.ai|writesonic\.com|quillbot\.com|chat\.suno\.com|turing\.microsoft\.com|cosmos\.microsoft\.com|orca\.microsoft\.com|phi\.microsoft\.com|megatron\.microsoft\.com|jarvis\.microsoft\.com|maia\.microsoft\.com|aitastic\.app|bnngpt\.com|chat-gpt\.org|(?:\w+\.)?edgepilot|firefly\.adobe\.com|edgeservices|iask\.ai|(?:\w+\.)?neeva|nimble\.ai|open-assistant\.io|(?:\w+\.)?copy\.ai|openchat\.so|blackbox\.ai|ex\.ai|cohere\.ai|anthropic\.com|chatglm\.cn|deepmind\.com|huggingface\.co|huggingchat\.com|wordtune\.com|reka\.ai|jasper\.ai|you\.com|openrouter\.ai|phind\.com|pi\.ai|zhipu\.ai|felo\.ai|chat\.qwen\.ai|(?:\w+\.)?qwenlm\.ai|venice\.ai|duck\.ai|sider\.ai|webpilot\.ai|ai21\.com|lmarena\.ai|coze\.com|exa\.ai|forefront\.ai|komo\.ai|chinchilla\.ai|app\.loora\.ai
Tip: New AI platforms keep appearing. Once a quarter, it is worth checking the list of referrer domains under Referrers → Websites for new AI sources and extending the regex with the | operator.

5. Method 2: Configure channel attribution (from Matomo 4.x)

Channel attribution complements the segment: while segments are used for analysis, channel attribution permanently classifies traffic as a separate channel – visible in the report Referrers → Channels.

Administration Websites [Select website] Channel attribution
  1. In the Matomo backend, open the desired website under Administration → Websites.
  2. Select the Channel attribution tab.
  3. Click + Add new rule.
  4. Enter the channel name: Artificial Intelligence.
  5. Condition: Referrer URLmatches regular expression → paste in the regex.
  6. Place the rule above “Referral” in the order (drag & drop).
  7. Save. From now on, AI traffic will be classified as a separate channel.
Important: forward-looking only. Channel attribution applies to future sessions from the time it is set up. Historical data is not reclassified – that is why the segment from section 3 remains the right solution.

6. Method 3: Custom Dimension via Tag Manager

For granular analyses – for example, to see which specific AI platform sent a visitor – a Custom Dimension is recommended. This is set on every page view via the Matomo Tag Manager.

Requirement

Matomo Tag Manager must be enabled and the container must be embedded on the website. Check this in the Matomo backend under Tag Manager → Container.

Create JavaScript tag

Tag Manager Container Tags + Create new tag Matomo Analytics
  1. Create a new tag of the type “Custom HTML”.
  2. Trigger: “Page View” (All Page Views).
  3. Insert the following JavaScript code:
JavaScript – Set Custom Dimension for AI Traffic
(function() {
  var ref = document.referrer || '';
  var aiRegex = /chatgpt\.com|chat\.openai\.com|claude\.ai|perplexity(?:\.ai)?|gemini\.google\.com|deepseek\.com|copilot\.microsoft\.com|grok\.com|(?:\w+\.)?mistral\.ai|huggingface\.co|you\.com|phind\.com|duck\.ai|felo\.ai|coze\.com/;

  if (aiRegex.test(ref)) {
    // Extract the specific platform
    var platform = 'Other AI';
    if (/chatgpt\.com|chat\.openai\.com/.test(ref)) platform = 'ChatGPT';
    else if (/claude\.ai/.test(ref)) platform = 'Claude';
    else if (/perplexity/.test(ref)) platform = 'Perplexity';
    else if (/gemini\.google\.com/.test(ref)) platform = 'Gemini';
    else if (/deepseek\.com/.test(ref)) platform = 'DeepSeek';
    else if (/copilot\.microsoft\.com/.test(ref)) platform = 'Copilot';
    else if (/grok\.com/.test(ref)) platform = 'Grok';
    else if (/mistral/.test(ref)) platform = 'Mistral';
    else if (/huggingface\.co/.test(ref)) platform = 'HuggingFace';

    // Set Custom Dimension 1 (adjust dimension ID if needed)
    _paq.push(['setCustomDimension', 1, platform]);
  }
})();
  1. Under Administration → Custom Dimensions → Visits, create a new dimension: Name AI Platform, Scope Visit. Adjust the assigned ID (e.g. 1) accordingly in the code above.
  2. Save the tag and publish the container.
  3. From now on, the dimension is available in reports under Visitors → Custom Dimensions.
Result: In the report, you will not only see “Total AI Traffic”, but also a breakdown by ChatGPT, Claude, Perplexity, Gemini, etc. – including session duration, pages per visit and conversions per platform.

7. Analyze AI traffic in reports

As soon as the segment is active, it is available in every Matomo report as a filter. The most important reports for AI traffic analysis:

ReportPath in MatomoWhat you see
Referrer sourcesReferrers → WebsitesWhich AI domains send traffic (chatgpt.com, claude.ai, perplexity.ai …)
PagesBehavior → PagesWhich content AI users visit, bounce rate, time on page per page
Landing pagesBehavior → Entry PagesWhich pages are visited first – shows the relevance of the content
Visit overviewVisitors → OverviewAverage session duration, pages/visit, bounce rate over time
Goals & conversionsGoals → OverviewHow many AI users convert – value contribution of the channel
Visitor flowBehavior → Visitor FlowWhich pages AI users visit after the landing page

Activate segment

Any report Segment dropdown at the top Select “AI Traffic”

The segment filters the entire report immediately. All metrics – visits, time on site, bounce rate, goals – then refer only to sessions that came via AI platforms.

8. AI vs. Paid: set up channel comparison

Starting with version 4.x, Matomo offers the segment comparison feature: two segments are displayed side by side in one report. This makes it possible to compare AI traffic directly with Paid Search.

Create second segment: Paid Search

  1. Open the segment editor → create a new segment: Name Paid Search.
  2. Condition: Channelis equal toPaid Search.
    Alternatively: Referrer typeis equal toSearch engines (paid).
  3. Save.

Activate comparison

Any report Segment dropdown “+ Add segment for comparison”
  1. In the segment dropdown, select the first segment AI Traffic.
  2. Click “+ Add segment” and add Paid Search.
  3. Matomo displays both segments side by side – with all metrics from the active report.
  4. Optional: add a third segment Organic Search for the full channel comparison.
What you will see: AI traffic often has an above-average session duration and a high number of pages – because users have usually already prepared their topic within the AI system. A low time on site indicates a lack of content relevance.

9. Export data & automate

Manual export

Any report with active segment Export icon at the top right CSV / XML / JSON / PDF

Matomo exports the current report including the active segment in various formats. CSV is suitable for Excel analysis, PDF for client reports.

Automation via Reporting API

The Matomo Reporting API allows fully automated data queries with segment filtering. Example URL for the page report with AI segment:

Matomo API – Page report with AI segment (example)
https://[YOUR-MATOMO-URL]/index.php
  ?module=API
  &method=Actions.getPageUrls
  &idSite=1
  &period=month
  &date=last3
  &format=CSV
  &token_auth=[YOUR-TOKEN]
  &segment=referrerUrl=~chatgpt.com,
           referrerUrl=~claude.ai,
           referrerUrl=~perplexity.ai
Tip: The API token can be found under Administration → Personal Settings → API Authentication Token. For automated reports, a dedicated read-only token is recommended.

Scheduled reports by email

Administration Scheduled reports + Create new report

Matomo can send reports automatically by email – daily, weekly or monthly, as PDF or CSV. The segment can be stored as a filter in the report.

10. Multi-Site: one setup for all websites

Matomo offers a decisive advantage here over GA4: in one Matomo instance, segments can be created globally and used simultaneously across multiple websites.

Create global segment

  1. Open the segment editor → create a new segment.
  2. When saving, select the option “All websites” (instead of a specific website).
  3. The segment is now available in every website within the Matomo instance.

Channel attribution: set up per website

Channel attribution must be configured separately for each website – it is website-specific. With the prepared regex, however, this takes less than 3 minutes per website.

API-based rollout (for many websites)

Using the Matomo Admin API, segments and channel rules can be created programmatically and rolled out across any number of websites. This is useful for agencies with 10+ websites in one Matomo instance.

Multi-Site summary: Create one global segment → usable in all websites. Channel attribution per website: 3 minutes with the regex. Dashboards in Matomo can also be created across websites.

11. Frequently asked questions

Does Matomo have custom channel groups like GA4?

Not directly. Matomo offers segments (retroactive for all historical data) and, starting with Matomo 4.x, channel attribution under Administration. For most use cases, segments are the faster and more flexible solution.

Does the segment also work on historical data?

Yes – that is a key advantage over GA4. Matomo segments are calculated at the time of analysis and apply retroactively to all stored raw data, regardless of when the segment was created.

Does the same regex work as in GA4?

Yes. Matomo uses PCRE regex, which is fully compatible with the GA4 regex. The regex from this article can be pasted directly into Matomo without any adjustments.

What is the difference between a segment and channel attribution?

Segments apply retroactively to all stored data and are available immediately. Channel attribution permanently classifies traffic as a separate channel in the Channels report, but only applies to future sessions from the time it is set up. Both methods complement each other well.

Can I compare multiple websites in one Matomo instance?

Yes. Global segments are available across all websites in a Matomo instance. The Matomo Reporting API can be used to centrally query and combine data from multiple websites.

Do you need Matomo Cloud or is the self-hosted version enough?

All functions described in this article – segments, channel attribution, custom dimensions, API – are available both in the self-hosted open-source version and in Matomo Cloud. Channel attribution requires Matomo 4.x or higher.

Is it worth the effort for small websites?

Yes – especially then. AI traffic is growing disproportionately fast. Matomo has the advantage that no historical data is lost: the segment immediately delivers results for all previous data.

SEYBOLD ONE assessment · since 1998

Matomo has a strategic advantage over GA4 that is often underestimated: the retroactive effect of segments means that companies that have been using Matomo for a longer period can immediately obtain a complete historical analysis of their AI traffic – without any data gap. This makes the growth trend particularly clear. Combined with GDPR compliance and hosting on your own server, Matomo is the more convincing choice for many of our clients for this type of analysis.

Have your AI visibility analyzed

We set up the Matomo segment for your website and show where AI systems are already mentioning you – and where untapped potential exists.

Request a free initial consultation