filtering-bot-traffic
Skill này làm gì
Skill này dạy agent nhận diện bot, crawler và AI agent trong dữ liệu PostHog và loại chúng khỏi các con số của bạn. Skill dành cho chủ website muốn phân tích thể hiện khách truy cập là người.
Khi nào nên dùng
- ✓Khi bạn muốn loại bot khỏi lượt xem trang hoặc các báo cáo khác.
- ✓Khi bạn muốn biết bao nhiêu phần lưu lượng đến từ bot hoặc AI crawler.
- ✓Khi bạn muốn biết một công cụ AI cụ thể có đang truy cập website của bạn không.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/products/web_analytics/skills/filtering-bot-traffic/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bao nhiêu phần lưu lượng website của tôi là bot? Hãy cho tôi xem các con số của tôi khi đã loại bot.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
PostHog phân loại từng request theo user agent của nó. Agent dùng các phân loại đó trong truy vấn hoặc trình tạo insight để đưa vào hoặc loại trừ lưu lượng bot trong các báo cáo lịch sử.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 properties.$raw_user_agent (and optionally properties.$ip) as is, the same arguments the
virtual properties use. Don't wrap it, e.g. in coalesce(...): server and mobile SDK events (and
cookieless events) are exempt from the empty-UA rule only when the argument is that plain field.
| Function | Returns |
|---|---|
isLikelyBot(ua) |
true on a bot pattern or empty UA (server/mobile SDK events exempt) |
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 |
Câu hỏi thường gặp
Skill này có bao quát lưu lượng bot trực tiếp không?
Không. Các câu hỏi về bot trực tiếp thuộc về một skill lưu lượng trực tiếp riêng, còn skill này dành cho báo cáo lịch sử.
Nó có thể cho biết tên các bot đang truy cập website không?
Có. Nó có thể chia lưu lượng theo tên bot và đơn vị vận hành, để bạn biết crawler nào chịu trách nhiệm.
Tôi có dùng nó trong insight và dashboard đã lưu không?
Có. Nó hoạt động trong các khoảng thời gian lịch sử, insight đã lưu, dashboard và bộ lọc.
Chi tiết
Mô tả gốc của tác giả
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.
repo: PostHog/posthog
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6975
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.