How to build a segment in Yandex Metrica for traffic from AI assistants by source domain and UTM tag

AI traffic in Metrica is identified by a segment with two conditions combined using OR: the referrer domain and the utm_source value, because an AI visit can come from either one.Regexes in Metrica use RE2 syntax, and Metrica distinguishes label values by case, so the label condition uses the (?i) flag. In Metrica, create a visit-based segment and add two conditions to it: the first based on the referrer domain, and the second based on the utm_source value, and link them with OR. For each condition, select the regular expression match and paste the value below into its respective condition:

Referrer domain condition: ^(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai|deepseek\.com|grok\.com)$ utm_source condition: (?i)^(chatgpt(\.com)?|perplexity(\.ai)?|gemini|copilot|deepseek|claude|grok)$

The services in the list are taken from the GA4 documentation and a Tenpoint Labs study; the domains are the addresses of these services. The sources confirm only chatgpt.com as a label value; I added the other variants as likely options: check them against the label report for your counter. The yandex.ru domain is not included because Alice’s search answer has the same referrer as organic traffic, so the segment would capture all search results. GigaChat is also excluded until its referrer is confirmed.

How to identify AI visits in GA4 with a custom channel group

GA4 has a built-in AI Assistant channel for ChatGPT, Gemini, DeepSeek, Copilot, and Grok; AI Overviews and AI Mode are not included. Google attributes a visit to this channel based on the referrer: if the referrer matches the list of AI assistants, the medium gets the value ai-assistant, while visits without a referrer do not enter the channel. According to Google, Direct means a visit via a saved link or a manually entered address, but AI visits without a referrer end up there.

A custom channel group is needed for services outside the default list.Channel condition: session source matches the regex

^(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai|deepseek\.com|grok\.com)$

If the report contains labels without a domain, such as utm_source=perplexity, add them to the same bracket separated by a vertical bar. In the help for custom channel groups, Google asks that the AI channel be placed above Referrals in the list.

How to estimate what share of direct traffic came from AI services

The hidden share can only be estimated based on visit characteristics. A visit with a GA4 AI label is already attributed to an AI source: Tenpoint Labs examined 489,920 direct sessions across 10 sites and found not a single one labeled as ChatGPT, Perplexity, Gemini, Copilot, or Claude. This leaves visits with no label or referrer. Tenpoint used the most generous assumption that all engaged direct visits to deep pages came from AI, and even then obtained only 6.3% of direct traffic on the 6 sites with enough AI visits for the calculation. By comparison, Ramp, which Tenpoint cites, puts the figure at 30–40%.

The segment for Metrica below is based on the same assumption. I propose the thresholds, but they should be challenged:

ym:s:lastTrafficSource=='direct' AND ym:s:startURL!~'^https?://[^/]+/?(\?.*)?$' AND ym:s:startURL!~'/(blog|promo|landing)/' AND ym:s:bounce=='No'AND (ym:s:pageViews>=2 OR ym:s:visitDuration>=30)
  • the second line excludes visits to the homepage; the regex in Metrica applies to the full URL, including the protocol and domain, so it starts with https?://;

  • the third filters out the sections to which you yourself drive ad and search traffic; replace the list with your own;

  • the last two leave only engaged visits: no bounce and either two page views or 30 seconds on the site.

Without an engagement threshold, the segment will fill up with junk. On 6 of the 8 Tenpoint sites, direct visits to deep pages showed noticeably lower engagement than AI referrals and organic search. According to the authors, such visits look more like bots and link previews. In a previous article, I described a deep page with no SEO or ads but with direct traffic as a suspicious pattern: it is worth checking, but the page does not by itself prove that the visit came from a neural network.

The share is calculated as follows: divide the segment’s visits by all direct visits over the same period. The result was noticeably above 6.3%—first, look for bots and link previews.

Точная часть идёт по верхней ветке, оценка получается только после фильтров нижней ветки.
The exact figure comes from the upper branch; an estimate can only be obtained after applying the filters in the lower branch.

Where AI traffic measurement is inaccurate and how to present the final figure

The count is inaccurate in four places, and the segment’s thresholds do not address them.

  • TAG162@@Alice AI. Its search response comes from yandex.ru/search and gets lost among organic results, while the Alice chat is counted as direct traffic and can only be included in the estimate.
  • A spike in direct visits after a publication cited by neural networks.This is a correlation: the increase may have resulted from a repost in a closed chat or a newsletter.

  • Device. Direct visits to deep pages on Tenpoint came mainly from desktop, as did AI referrals, although ChatGPT apps may lose the referrer.

  • Small numbers. The only weak signal in Tenpoint’s data—a weekly match between engaged direct visits to the homepage and AI referrals (r = 0.45 on one site)—held steady at around five AI visits per week and did not survive correction.

The standard source report undercounts traffic from AI platforms: it counts only visits where the AI platform itself passed a referrer or UTM tag. A count that can be trusted consists of two parts: an exact part, visible from the referrer and UTM, and an estimated part identified from direct traffic based on visit characteristics. The second part should be presented as an estimate with clear assumptions: a threshold of two page views or 30 seconds, excluded sections, bots and link previews that the segment does not filter out.In the report, this is split into two rows: the exact figure and the estimate: the number of direct visits that match the segment criteria.

Показываем не одно число, а вилку: от точной части слева до точной плюс оценка справа.
We show not a single number but a range: from the exact figure on the left to the exact figure plus the estimate on the right.

I’m curious who had a hidden share noticeably above 6.3%, and how you filtered out bots and link previews.