/filtering-bot-traffic
Identify, measure, and exclude bot / crawler / AI-agent traffic in PostHog web and product analytics using the traffic classification surface (the isLikelyBot / getTrafficType HogQL functions and the $virt_* virtual properties). Use when the user asks to "exclude bots", "filter
$ npx -y skills add posthog/posthog --skill filtering-bot-traffic --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/filtering-bot-traffic
Context preview
The summary Claude sees to decide when to auto-load this skill.
Identify, measure, and exclude bot / crawler / AI-agent traffic in PostHog web and product analytics using the traffic classification surface (the isLikelyBot / getTrafficType HogQL functions and the $virt_* virtual properties). Use when the user asks to "exclude bots", "filter
SKILL.md
filtering-bot-traffic.SKILL.mdname: filtering-bot-traffic
description: 'Identify, measure, and exclude bot / crawler / AI-agent traffic in PostHog web and product analytics using the traffic classification surface (the isLikelyBot / getTrafficType HogQL functions and the $virt_* virtual properties). Use when the user asks to "exclude bots", "filter out crawlers", "remove bot traffic from my numbers", "how much of my traffic is bots / AI crawlers", "is GPTBot / ChatGPT / Claude hitting my site", "break down traffic by human vs bot", or wants clean human-only counts in an insight or dashboard. For the real-time Live tab bot tiles, use exploring-live-traffic instead.'
Filtering and measuring bot traffic
PostHog classifies every request by user agent so you can tell humans apart from bots, crawlers, and AI agents anywhere HogQL runs — the SQL editor, insights, trends, and Web analytics breakdowns. This skill teaches you (the agent) how to use that classification to:
- exclude bots so analytics reflect human traffic only
- measure how much traffic is automated, and which bots / operators are responsible
- separate AI-agent traffic (worth measuring) from noise (worth dropping)
- pick the right surface — virtual properties for the insight builder, functions for raw SQL
For real-time ("right now", last 30 min) bot questions and the Live tab tiles, use the **exploring-live-traffic** skill instead. This skill is for historical windows, saved insights, dashboards, and filtering.
When to use this skill
Use it when the user wants to:
- exclude or filter out bots ("remove bots from my pageviews", "humans only")
- quantify automated traffic ("what % of traffic is bots?", "how much is AI crawlers?")
- find which bots hit them ("which crawlers visit us?", "is ChatGPT reading our docs?")
- break a trend down by traffic type or bot name
- measure AI-agent / AI-search traffic specifically (AEO / answer-engine visibility)
Do **not** use it for the Live tab, real-time numbers, or the per-minute bot charts — that is exploring-live-traffic.
The classification surface
Two equivalent ways to reach the same classification. Prefer **virtual properties** in the insight builder and filters; use **functions** in hand-written SQL or when you need a value the virtual properties don't expose.
Virtual properties (insight builder, filters, breakdowns)
These read the user agent for you (falling back from `$raw_user_agent` to `$user_agent`), so you don't pass anything in. Available wherever you pick an event property.
| Property | Value | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `$virt_is_bot` | boolean — `true` for bots / crawlers / automation | | `$virt_traffic_type` | `Regular`, `AI Agent`, `Bot`, or `Automation` | | `$virt_traffic_category` | finer category, e.g. `ai_crawler`, `ai_search`, `ai_assistant`, `search_crawler`, `seo_crawler`, `social_crawler`, `monitoring`, `http_client`, `headless_browser`, `no_user_agent`, `regular` | | `$virt_bot_name` | display name, e.g. `Googlebot`, `GPTBot`, `ClaudeBot` | | `$virt_bot_operator` | company behind the bot, e.g. `Google`, `OpenAI`, `Anthropic` |
HogQL functions (raw SQL)
Pass the user agent explicitly. Use `coalesce(nullIf(properties.$raw_user_agent, ''), properties.$user_agent)` to cover both server-side (`$raw_user_agent`) and JS SDK (`$user_agent`) captures. The `nullIf` keeps an empty `$raw_user_agent` from shadowing a real `$user_agent` and being misread as a bot — this mirrors the expression the virtual properties use internally.
| Function | Returns | | ------------------------ | ---------------------------------------------------------------------------- | | `isLikelyBot(ua)` | `true` if the UA matches a bot/automation pattern (empty UA counts as a bot) | | `getTrafficType(ua)` | `AI Agent` / `Bot` / `Automation` / `Regular` | | `getTrafficCategory(ua)` | subcategory; `regular` for humans | | `getBotType(ua)` | same subcategory but empty string for humans — handy for filtering | | `getBotName(ua)` | bot name; empty for humans | | `getBotOperator(ua)` | operator/company; empty for humans |
Traffic types — what to keep vs drop
`getTrafficType` / `$virt_traffic_type` sorts every request into four buckets. The default move differs per bucket — don't treat them all as noise:
| Type | What it is | Default move | | ------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `Regular` | Human visitors
Read more
name: filtering-bot-traffic description: 'Identify, measure, and exclude bot / crawler / AI-agent traffic in PostHog web and product analytics using the traffic classification surface (the isLikelyBot / getTrafficType HogQL functions and the $virt_* virtual properties). Use when the user asks to "exclude bots", "filter out crawlers", "remove bot traffic from my numbers", "how much of my traffic is bots / AI crawlers", "is GPTBot / ChatGPT / Claude hitting my site", "break down traffic by human vs bot", or wants clean human-only counts in an insight or dashboard. For the real-time Live tab bot tiles, use exploring-live-traffic instead.'
Filtering and measuring bot traffic
PostHog classifies every request by user agent so you can tell humans apart from bots, crawlers, and AI agents anywhere HogQL runs — the SQL editor, insights, trends, and Web analytics breakdowns. This skill teaches you (the agent) how to use that classification to:
- exclude bots so analytics reflect human traffic only
- measure how much traffic is automated, and which bots / operators are responsible
- separate AI-agent traffic (worth measuring) from noise (worth dropping)
- pick the right surface — virtual properties for the insight builder, functions for raw SQL
For real-time ("right now", last 30 min) bot questions and the Live tab tiles, use the **exploring-live-traffic** skill instead. This skill is for historical windows, saved insights, dashboards, and filtering.
When to use this skill
Use it when the user wants to:
- exclude or filter out bots ("remove bots from my pageviews", "humans only")
- quantify automated traffic ("what % of traffic is bots?", "how much is AI crawlers?")
- find which bots hit them ("which crawlers visit us?", "is ChatGPT reading our docs?")
- break a trend down by traffic type or bot name
- measure AI-agent / AI-search traffic specifically (AEO / answer-engine visibility)
Do **not** use it for the Live tab, real-time numbers, or the per-minute bot charts — that is exploring-live-traffic.
The classification surface
Two equivalent ways to reach the same classification. Prefer **virtual properties** in the insight builder and filters; use **functions** in hand-written SQL or when you need a value the virtual properties don't expose.
Virtual properties (insight builder, filters, breakdowns)
These read the user agent for you (falling back from `$raw_user_agent` to `$user_agent`), so you don't pass anything in. Available wherever you pick an event property.
| Property | Value | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `$virt_is_bot` | boolean — `true` for bots / crawlers / automation | | `$virt_traffic_type` | `Regular`, `AI Agent`, `Bot`, or `Automation` | | `$virt_traffic_category` | finer category, e.g. `ai_crawler`, `ai_search`, `ai_assistant`, `search_crawler`, `seo_crawler`, `social_crawler`, `monitoring`, `http_client`, `headless_browser`, `no_user_agent`, `regular` | | `$virt_bot_name` | display name, e.g. `Googlebot`, `GPTBot`, `ClaudeBot` | | `$virt_bot_operator` | company behind the bot, e.g. `Google`, `OpenAI`, `Anthropic` |
HogQL functions (raw SQL)
Pass the user agent explicitly. Use `coalesce(nullIf(properties.$raw_user_agent, ''), properties.$user_agent)` to cover both server-side (`$raw_user_agent`) and JS SDK (`$user_agent`) captures. The `nullIf` keeps an empty `$raw_user_agent` from shadowing a real `$user_agent` and being misread as a bot — this mirrors the expression the virtual properties use internally.
| Function | Returns | | ------------------------ | ---------------------------------------------------------------------------- | | `isLikelyBot(ua)` | `true` if the UA matches a bot/automation pattern (empty UA counts as a bot) | | `getTrafficType(ua)` | `AI Agent` / `Bot` / `Automation` / `Regular` | | `getTrafficCategory(ua)` | subcategory; `regular` for humans | | `getBotType(ua)` | same subcategory but empty string for humans — handy for filtering | | `getBotName(ua)` | bot name; empty for humans | | `getBotOperator(ua)` | operator/company; empty for humans |
Traffic types — what to keep vs drop
`getTrafficType` / `$virt_traffic_type` sorts every request into four buckets. The default move differs per bucket — don't treat them all as noise:
| Type | What it is | Default move | | ------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `Regular` | Human visitors
:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Repo: posthog/posthog
Other skills on posthog.
- /analyzing-expensive-users
Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.
Open skill - /creating-online-evaluations
Author continuously-running online evaluations in PostHog AI observability, grounded in real failure modes you've identified. Use when the user wants evaluations that automatically score new generations or whole traces going forward — "create an eval to catch X", "continuously
Open skill - /exploring-ai-failures
Find where an AI/LLM application is failing in production and surface the failure patterns, working from real traces. Use when someone wants to understand what's going wrong with an AI feature, find and categorize failure modes, triage errors, or investigate quality issues
Open skill - /exploring-llm-clusters
Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters.
Open skill - /exploring-llm-costs
Investigate LLM spend in PostHog — total cost over time, cost by model, provider, user, trace, or custom dimension, token and cache-hit economics, and cost regressions. Use when the user asks "how much are we spending on LLMs?", "which model / user / feature is most expensive?",
Open skill - /exploring-llm-evaluations
Investigate AI observability evaluations — `hog` (deterministic code-based), `llm_judge` (LLM-prompt-based), and `sentiment` (user-message sentiment). Find existing evaluations, inspect their configuration, run them against specific generations, query individual results, and
Open skill

