PostHog setup

PostHog: the AI channel type and a $referring_domain filter

PostHog web analytics defines the channel type AI as "A link from an AI assistant, e.g. ChatGPT, Claude, or Perplexity" and classifies visits by UTMs and referring domains. The dashboard page we read documents no referrer filter and no regex operator, so a custom filter on $referring_domain is unverified syntax until you confirm it in your project.

Updated Last checked How we check

On this page

Copy the filter for PostHog

Assistants

Hostnames

Only hostnames with a test or a vendor source.

UTM variants

For hand-made tags such as utm_source=chatgpt.

7 values for posthog.

Native: channel type
Channel type = AI

PostHog documents the channel type AI: a link from an AI assistant, for example ChatGPT, Claude or Perplexity.

Property filter (verify the operator in your project)
$referring_domain  matches regex  ^(copilot\.microsoft\.com|gemini\.google\.com|chat\.mistral\.ai|perplexity\.ai|chatgpt\.com|www\.meta\.ai|claude\.ai)$

The dashboard page we read does not document a regex operator for referrers. Check that your filter menu offers it.

HogQL (verify in your project)
match(properties.$referring_domain, '^(copilot\\.microsoft\\.com|gemini\\.google\\.com|chat\\.mistral\\.ai|perplexity\\.ai|chatgpt\\.com|www\\.meta\\.ai|claude\\.ai)$')

Uses the standard property $referring_domain. Backslashes are doubled because HogQL string literals treat a backslash as an escape. We have not run it against a PostHog project.

Checked locally in your browser against the pattern above.

Syntax unverified7 values

  • Syntax for the referrer filter is unverified: the documentation page we read does not show it. Prefer the native AI channel and test any custom filter on a known visit.
  • The list holds exact hostnames. A www. variant (for example www.chatgpt.com) is recognized by the referrer checker but is not in this pattern; add it if your reports show it.

Built from the referrer list (checked ). Settings are not saved; the page works offline once loaded.

What is documented

TopicPostHog's page saysStatus
Channel type AIA link from an AI assistant, e.g. ChatGPT, Claude, or PerplexityDocumented
How it classifiesThrough UTMs and referring domainsDocumented
Session attribution explorerShows the session count for each combination of channel type, referrer and UTMDocumented
Rule inputs (channel type page)A utm_source value (for example chatgpt, claude) or a referring domain (for example chatgpt.com, claude.ai, gemini.google.com)Documented
Rule orderThe first matching rule decides the channel type; within a category the utm_source checks come before the referring-domain checksDocumented as order; precedence is our reading
Referrer as a dashboard filterNot listed among the filters on the page we readOpen
Regex operatorNot mentioned on that pageUnverified

A referring-domain filter

$referring_domain is PostHog's standard property for the referrer host. The generator prints two forms: a property filter with the operator "matches regex" and a HogQL expression using match(). We have not run either against a PostHog project, and the page we read does not show the operator, so they are labeled unverified.

  1. Start with the native channel type AI in the dashboard and the session attribution explorer.
  2. To cross-check, add a property filter on the referring domain and look for a regex operator in the menu.
  3. If your menu has no regex operator, run the HogQL form in a SQL insight instead.
  4. Test with a known click. If the count looks wrong, trust the native channel over the custom filter.

Limits

Follow-up questions

Which assistants does the AI channel include?

The dashboard page gives ChatGPT, Claude and Perplexity as examples; the channel type page adds Gemini and Copilot. Neither is a complete hostname list. Use the explorer to see which referrers land in the channel in your data.

Does a UTM tag beat the referrer in PostHog's AI channel?

PostHog's channel type page says the first matching rule wins and lists utm_source checks before referring-domain checks, which suggests a tag is read first. The page does not state that as a principle, so confirm it with a known click in the session attribution explorer. For a tag that an assistant such as Gemini is only reported to add, read the raw values first.

Is the HogQL snippet safe to paste?

It only reads a property and compares it with a pattern; it changes nothing. It is unverified for syntax, so run it on a small date range first.

Sources

Read on . Links lead to the original pages.