# filtering-bot-traffic

filtering-bot-traffic splits human traffic from bots and AI crawlers in PostHog. Use it to clean a metric or to see how much of the traffic runs on autopilot.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 208 installs · ★ 101 repo stars
- Author: PostHog
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/filtering-bot-traffic/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/filtering-bot-traffic

## What it does

The skill hands the agent a classification map for PostHog traffic. Requests get sorted by user agent into four buckets: `Regular`, `AI Agent`, `Bot`, `Automation`. From there the agent either drops the noisy part from an insight or measures how much came from crawlers and which company runs them.

Inside the insight builder and filters you get virtual properties: `$virt_is_bot`, `$virt_traffic_type`, `$virt_traffic_category`, `$virt_bot_name`, `$virt_bot_operator`. They read the user agent on their own. In hand-written SQL the same answers come from `isLikelyBot`, `getTrafficType`, `getBotType` and the rest.

One thing breaks quietly in HogQL: the argument has to be the plain `properties.$raw_user_agent`. Wrap it in `coalesce(...)` and events from server and mobile SDKs lose their exemption for an empty user agent, so bot counts inflate. Filtering changes the numbers in a query only; stored events stay untouched. Real-time questions and the Live tab tiles belong to the `exploring-live-traffic` skill.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/filtering-bot-traffic/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/filtering-bot-traffic/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/filtering-bot-traffic/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/filtering-bot-traffic/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/ai-plugin skills/filtering-bot-traffic
```

2. **Manually: put the files in place**
- File: `.github/skills/filtering-bot-traffic/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/ai-plugin --path skills/filtering-bot-traffic
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/filtering-bot-traffic/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill filtering-bot-traffic -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/filtering-bot-traffic/SKILL.md

## When to use it
- drop bots from pageview and session counts
- measure the share of traffic coming from AI crawlers
- list which crawlers and operators reach the site
- split a trend by traffic type
- build a dashboard with human visitors only

## Example prompts
- Filter crawlers out of the signup funnel: keep only events where `$virt_is_bot` is false.
- What share of last month's traffic was AI agents? Break it down by `$virt_bot_name`.
- Which bot operators hit our docs most often?

## Similar
- [exploring-live-traffic](https://affpapa.org/en/nevibecode/skills/exploring-live-traffic.md) — skill · 469 installs
- [seo-traffic-diagnosis](https://affpapa.org/en/nevibecode/skills/seo-traffic-diagnosis.md) — skill · 290 installs
- [similarweb-traffic](https://affpapa.org/en/nevibecode/skills/similarweb-traffic.md) — skill · 227 installs
- [traffic-analysis](https://affpapa.org/en/nevibecode/skills/traffic-analysis.md) — skill · 1300 installs
- [seo-posthog](https://affpapa.org/en/nevibecode/skills/seo-posthog.md) — skill · 141 installs
- [querying-posthog-data](https://affpapa.org/en/nevibecode/skills/querying-posthog-data.md) — skill · 890 installs

From the same set: [posthog/ai-plugin](https://affpapa.org/en/nevibecode/by/posthog/ai-plugin.md) — 82 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
