exploring-live-traffic

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Exploring Web analytics live traffic

探索Web分析实时流量

The Web analytics Live tab (
/web/live
) shows real-time activity over a 30-minute sliding window plus a 60-second "users online" count. It is the place to answer "what is happening on my site right now?" — pageviews, named bots, devices, geo, top paths, top referrers, and a live event feed.
This skill teaches you (the agent) how to:
  • recognize a request that belongs on the Live tab
  • read the tile model (what each card shows, where the data comes from)
  • manipulate the only filter that exists (host)
  • build product-analytics insights that match a Live tile when the user wants longer time ranges or deeper drill-down than the live window offers
The Live tab is not a HogQL playground — its data comes from a livestream backed by short HogQL backfills. When the user wants to query "right now" data with HogQL, point them at the tab; when they want historical breakdowns, build an insight with the patterns below.
Web分析Live标签页(
/web/live
)展示30分钟滑动窗口内的实时活动数据,以及过去60秒的“在线用户”统计。这里是回答“我的网站现在发生了什么?”的最佳场所——包括页面浏览量、已识别机器人、设备、地域信息、热门路径、热门来源网站,以及实时事件流。
本技能将教你(Agent)如何:
  • 识别属于Live标签页处理范畴的请求
  • 理解卡片模型(每张卡片展示的内容、数据来源)
  • 操作唯一可用的筛选器(主机域名)
  • 当用户需要比实时窗口更长的时间范围或更深入的钻取分析时,构建与Live标签页卡片匹配的产品分析洞察
Live标签页不是HogQL的试验场——其数据来自实时流,辅以短期HogQL回填。当用户想要用HogQL查询“当前”数据时,引导他们使用该标签页;当用户需要历史细分数据时,按照以下模式构建洞察。

When to use this skill

何时使用本技能

Use this skill when the user:
  • asks "who is on my site right now?", "what is happening live?", "show me live traffic"
  • mentions the "Live" tab, the "Live dashboard", or the live page (
    /web/live
    )
  • asks about live bot traffic ("which bots are crawling me?", "is GPTBot scraping us?")
  • wants to filter live traffic by domain / host
  • wants to compare what they see on the Live tab to a longer time window — e.g. "the live tab shows GPTBot is hammering us, can you give me a 7-day chart of that?"
Do not use this skill for non-realtime web analytics work — for that, use the standard Web analytics tab (
/web
).
当用户:
  • 询问“现在谁在访问我的网站?”“实时情况如何?”“展示实时流量”
  • 提及“Live标签页”“实时仪表板”或实时页面(
    /web/live
  • 询问实时机器人流量(“哪些机器人在抓取我的网站?”“GPTBot是否在抓取我们的内容?”)
  • 想要按域名/主机筛选实时流量
  • 想要将Live标签页显示的数据与更长时间窗口进行对比——例如“Live标签页显示GPTBot在频繁访问我们,能否给我一份7天的相关图表?”
请勿将本技能用于非实时Web分析工作——此类工作请使用标准Web分析标签页(
/web
)。

Tab structure

标签页结构

URL:
/web/live
The tab has two filter affordances and a grid of tiles. Date range is fixed: 30 minutes sliding window for everything except "Users online" (last 60 seconds).
URL:
/web/live
该标签页包含两个筛选控件和一组卡片。时间范围是固定的:除“在线用户”统计(过去60秒)外,所有数据均基于30分钟滑动窗口。

Filters

筛选器

There is only one filter on the live tab: the host (domain) selector.
  • It comes from
    webAnalyticsFilterLogic.selectedHost
    .
  • It is shared with the rest of Web analytics, so changing it on
    /web
    propagates to
    /web/live
    and vice-versa.
  • It is gated by feature flag
    WEB_ANALYTICS_LIVE_DOMAIN_FILTER
    . If the flag is off, no host filter UI is rendered and all tiles show data across every domain.
  • Setting the host filter narrows: the SSE stream, the HogQL backfill queries (so the initial 30 min is host-scoped), and the "users online" count.
  • There is no date picker, no compare control, no property filters, no test-account filter on the Live tab. Do not promise the user controls that don't exist.
When the user asks "filter live traffic by domain
<host>
", direct them to the Domain selector at the top of the Live tab. There is no URL param to set it directly — it persists in
localStorage
via
webAnalyticsFilterLogic
.
Live标签页上只有一个筛选器:主机(域名)选择器。
  • 数据来源于
    webAnalyticsFilterLogic.selectedHost
  • 该筛选器与Web分析的其他模块共享,因此在
    /web
    上修改后会同步到
    /web/live
    ,反之亦然。
  • 该功能受特性标志
    WEB_ANALYTICS_LIVE_DOMAIN_FILTER
    控制。若该标志关闭,则不会显示主机筛选器UI,所有卡片将展示所有域名的汇总数据。
  • 设置主机筛选器将缩小以下范围:SSE流、HogQL回填查询(因此初始30分钟数据仅包含指定主机)以及“在线用户”统计。
  • Live标签页上没有日期选择器、对比控件、属性筛选器或测试账户筛选器。请勿向用户承诺不存在的控件。
当用户询问“按域名
<host>
筛选实时流量”时,引导他们使用Live标签页顶部的“域名”选择器。无法通过URL参数直接设置该筛选器——它通过
webAnalyticsFilterLogic
保存在
localStorage
中。

Stat cards (top strip)

统计卡片(顶部栏)

CardWhatWindow
Users onlineDistinct device IDs seen in the last 60 seconds60s
Unique visitorsDistinct device IDs in the last 30 min30m
Pageviews
$pageview
count in the last 30 min
30m
卡片名称展示内容时间窗口
在线用户过去60秒内出现的唯一设备ID数量60秒
独立访客过去30分钟内的唯一设备ID数量30分钟
页面浏览量过去30分钟内的
$pageview
事件数量
30分钟

Content cards

内容卡片

CardWhatNotes
Active users per minuteBar chart, new vs returning visitorslast 30 min
Top pagesAnimated leaderboard,
$pathname
+ view count
top 10, 30 min
Top referrersAnimated leaderboard,
$referring_domain
top 10, 30 min
DevicesBreakdown bars,
$device_type
top 6 + Other
BrowsersBreakdown bars with logos,
$browser
top 6 + Other
Top countriesBreakdown bars,
$geoip_country_code
top 6 + Other; replaced by a Country/City tab card if
WEB_ANALYTICS_LIVE_CITY_BREAKDOWN
is on
Bot requests per minuteBar chart, bot events / minuteflag
WEB_ANALYTICS_BOT_ANALYSIS
Bot trafficNamed bots ranked by event share, with category tagflag
WEB_ANALYTICS_BOT_ANALYSIS
; rows are clickable and open an insight for that specific bot
Countries (world map)SVG world map heatflag
WEB_ANALYTICS_LIVE_MAP
Live eventsStreamed event feed (event, person, URL, timestamp)last 50 events
Every tile (except the live event feed and world map) has an "Open as new insight" button that opens a 7-day Trends query in product analytics. The bot traffic tile rows are also individually clickable — clicking a bot row opens a single-bot trend.
卡片名称展示内容说明
每分钟活跃用户柱状图,区分新访客与回访访客过去30分钟
热门页面动态排行榜,展示
$pathname
及浏览次数
前10名,基于过去30分钟数据
热门来源网站动态排行榜,展示
$referring_domain
前10名,基于过去30分钟数据
设备分布分组柱状图,基于
$device_type
前6类+其他
浏览器分布带图标的分组柱状图,基于
$browser
前6类+其他
热门国家/地区分组柱状图,基于
$geoip_country_code
前6类+其他;若特性标志
WEB_ANALYTICS_LIVE_CITY_BREAKDOWN
开启,则替换为“国家/城市”标签页卡片
每分钟机器人请求量柱状图,每分钟机器人事件数量需开启特性标志
WEB_ANALYTICS_BOT_ANALYSIS
机器人流量按事件占比排序的已识别机器人,带分类标签需开启特性标志
WEB_ANALYTICS_BOT_ANALYSIS
;点击行可打开对应机器人的洞察分析
国家/地区(世界地图)SVG世界地图热力图需开启特性标志
WEB_ANALYTICS_LIVE_MAP
实时事件流流式事件 feed(事件、用户、URL、时间戳)最近50条事件
除实时事件流和世界地图外,每个卡片都有“打开为新洞察”按钮,可在产品分析模块中打开一个7天趋势查询。机器人流量卡片的行也可单独点击——点击某机器人行将打开该机器人的专属趋势分析。

Bot detection model

机器人检测模型

Bots are detected server-side. Three virtual properties are attached to the event before it lands in ClickHouse:
  • $virt_is_bot
    — boolean,
    true
    if classified as a bot
  • $virt_bot_name
    — string, the bot's display name (e.g.
    Googlebot
    ,
    GPTBot
    ,
    Claude
    ,
    Lighthouse
    ,
    HeadlessChrome
    )
  • $virt_traffic_category
    — string, the category key:
    ai_crawler
    ,
    ai_search
    ,
    ai_assistant
    ,
    search_crawler
    ,
    seo_crawler
    ,
    social_crawler
    ,
    monitoring
    ,
    http_client
    ,
    headless_browser
    ,
    no_user_agent
    ,
    regular
The Live bot tiles count "bot-eligible" events:
$pageview
,
$pageleave
,
$screen
,
$http_log
,
$autocapture
.
$http_log
is included because most bots emit server-side HTTP logs rather than JS pageviews.
机器人检测在服务端完成。事件进入ClickHouse前会附加三个虚拟属性:
  • $virt_is_bot
    — 布尔值,若被归类为机器人则为
    true
  • $virt_bot_name
    — 字符串,机器人的显示名称(例如
    Googlebot
    GPTBot
    Claude
    Lighthouse
    HeadlessChrome
  • $virt_traffic_category
    — 字符串,分类标识:
    ai_crawler
    ai_search
    ai_assistant
    search_crawler
    seo_crawler
    social_crawler
    monitoring
    http_client
    headless_browser
    no_user_agent
    regular
Live标签页的机器人卡片统计“符合机器人判定条件”的事件:
$pageview
$pageleave
$screen
$http_log
$autocapture
。纳入
$http_log
是因为大多数机器人会产生服务端HTTP日志,而非JS页面浏览事件。

Building product-analytics queries that mirror the Live tab

构建与Live标签页匹配的产品分析查询

When the user wants a longer window, a saved insight, a dashboard tile, or to share a view of what's on the Live tab, build a Trends insight. The "Open as new insight" buttons in the UI use exactly these recipes:
当用户需要更长时间窗口的数据、保存的洞察、仪表板卡片,或想要分享Live标签页的视图时,可构建Trends洞察。UI中的“打开为新洞察”按钮完全遵循以下规则:

Bot traffic breakdown (matches the bot tile header)

机器人流量细分(匹配机器人卡片表头)

A single chart of all bots over time, broken down by name. This is the canonical "who's crawling me?" view.
json
{
  "kind": "TrendsQuery",
  "interval": "hour",
  "dateRange": { "date_from": "-7d" },
  "series": [
    {
      "kind": "GroupNode",
      "custom_name": "Requests",
      "operator": "OR",
      "math": "total",
      "nodes": [
        { "kind": "EventsNode", "event": "$pageview", "math": "total" },
        { "kind": "EventsNode", "event": "$pageleave", "math": "total" },
        { "kind": "EventsNode", "event": "$screen", "math": "total" },
        { "kind": "EventsNode", "event": "$http_log", "math": "total" },
        { "kind": "EventsNode", "event": "$autocapture", "math": "total" }
      ]
    }
  ],
  "properties": [{ "key": "$virt_is_bot", "value": ["true"], "operator": "exact", "type": "event" }],
  "breakdownFilter": {
    "breakdown": "$virt_bot_name",
    "breakdown_type": "event",
    "breakdown_limit": 25
  },
  "trendsFilter": { "display": "ActionsBarValue" }
}
所有机器人随时间变化的单图表,按名称细分。这是标准的“谁在抓取我的网站?”视图。
json
{
  "kind": "TrendsQuery",
  "interval": "hour",
  "dateRange": { "date_from": "-7d" },
  "series": [
    {
      "kind": "GroupNode",
      "custom_name": "Requests",
      "operator": "OR",
      "math": "total",
      "nodes": [
        { "kind": "EventsNode", "event": "$pageview", "math": "total" },
        { "kind": "EventsNode", "event": "$pageleave", "math": "total" },
        { "kind": "EventsNode", "event": "$screen", "math": "total" },
        { "kind": "EventsNode", "event": "$http_log", "math": "total" },
        { "kind": "EventsNode", "event": "$autocapture", "math": "total" }
      ]
    }
  ],
  "properties": [{ "key": "$virt_is_bot", "value": ["true"], "operator": "exact", "type": "event" }],
  "breakdownFilter": {
    "breakdown": "$virt_bot_name",
    "breakdown_type": "event",
    "breakdown_limit": 25
  },
  "trendsFilter": { "display": "ActionsBarValue" }
}

Single bot drill-down (matches a clicked bot row)

单个机器人钻取分析(匹配点击机器人行后的视图)

json
{
  "kind": "TrendsQuery",
  "interval": "hour",
  "dateRange": { "date_from": "-7d" },
  "series": [
    /* same combined "Requests" GroupNode as above */
  ],
  "properties": [
    { "key": "$virt_is_bot", "value": ["true"], "operator": "exact", "type": "event" },
    { "key": "$virt_bot_name", "value": ["GPTBot"], "operator": "exact", "type": "event" },
    { "key": "$virt_traffic_category", "value": ["ai_crawler"], "operator": "exact", "type": "event" }
  ],
  "trendsFilter": { "display": "ActionsLineGraph" }
}
The category filter is optional — include it when the user asks about a specific bot+category combo (
Lighthouse · headless_browser
is a different signal from
Lighthouse · monitoring
).
json
{
  "kind": "TrendsQuery",
  "interval": "hour",
  "dateRange": { "date_from": "-7d" },
  "series": [
    /* 与上述相同的组合“Requests” GroupNode */
  ],
  "properties": [
    { "key": "$virt_is_bot", "value": ["true"], "operator": "exact", "type": "event" },
    { "key": "$virt_bot_name", "value": ["GPTBot"], "operator": "exact", "type": "event" },
    { "key": "$virt_traffic_category", "value": ["ai_crawler"], "operator": "exact", "type": "event" }
  ],
  "trendsFilter": { "display": "ActionsLineGraph" }
}
分类筛选器为可选——当用户询问特定机器人+分类组合时(
Lighthouse · headless_browser
Lighthouse · monitoring
是不同信号),可添加该筛选器。

Bot category breakdown (matches the bot events chart tile)

机器人分类细分(匹配机器人事件图表卡片)

Use breakdown by
$virt_traffic_category
instead of
$virt_bot_name
when the user wants "AI crawlers vs SEO crawlers vs everything else" rather than per-bot rows.
当用户想要查看“AI爬虫 vs SEO爬虫 vs 其他类型”而非单个机器人数据时,使用
$virt_traffic_category
作为细分维度,而非
$virt_bot_name

Top pages / referrers / devices / browsers / countries

热门页面/来源网站/设备/浏览器/国家/地区

For non-bot tiles, use
$pageview
with
math: unique_users
, breakdown by the underlying property:
Tilebreakdown propertydisplay
Top pages
$pathname
ActionsBarValue
Top referrers
$referring_domain
ActionsBarValue
Devices
$device_type
ActionsPie
Browsers
$browser
ActionsPie
Countries
$geoip_country_code
WorldMap
Always inherit the live tab's host filter when the user is asking about a specific domain — add
{ "key": "$host", "value": ["<host>"], "operator": "exact", "type": "event" }
to
properties
.
对于非机器人卡片,使用
$pageview
事件并设置
math: unique_users
,按对应属性进行细分:
卡片名称细分属性展示类型
热门页面
$pathname
ActionsBarValue
热门来源网站
$referring_domain
ActionsBarValue
设备分布
$device_type
ActionsPie
浏览器分布
$browser
ActionsPie
国家/地区分布
$geoip_country_code
WorldMap
当用户询问特定域名时,务必继承Live标签页的主机筛选器——在
properties
中添加
{ "key": "$host", "value": ["<host>"], "operator": "exact", "type": "event" }

Defaults to use

默认设置

  • dateRange.date_from
    :
    -7d
    unless the user names a window — the live view itself is 30 min, but the user is almost always asking about a longer window when they request an insight version.
  • interval
    :
    hour
    for 7-day windows,
    minute
    only for windows under a day,
    day
    for windows beyond 14 days.
  • Always inherit the host filter when one is set on the Live tab. Don't drop it silently — that changes the answer.
  • dateRange.date_from
    :除非用户指定时间窗口,否则设为
    -7d
    ——Live视图本身是30分钟窗口,但用户请求洞察版本时几乎总是需要更长时间范围的数据。
  • interval
    :7天窗口设为
    hour
    ,1天以内窗口设为
    minute
    ,14天以上窗口设为
    day
  • 当Live标签页设置了主机筛选器时,务必继承该筛选器。请勿无声丢弃——这会改变分析结果。

Common requests and the right move

常见请求及应对方案

User saysRight move
"What's happening on the site right now?"Send them to
/web/live
"Filter live traffic to
example.com
"
Use the Domain selector at top of
/web/live
"Show me bots crawling us in the last 30 min"
/web/live
→ Bot traffic tile
"Show me bots crawling us this week"Build the "Bot traffic breakdown" insight above with
date_from: -7d
"How much is GPTBot hitting us?"Build the "Single bot drill-down" insight, set
$virt_bot_name
to
GPTBot
"Why is the live tab showing X but my dashboard shows Y?"The live tab is a 30-min sliding window over events; dashboards aggregate over the picked range. They are not directly comparable beyond the last 30 min.
"Add a date range to the live tab"The Live tab has no date picker — for ranges, build a Trends insight using the patterns above
"Filter live traffic by browser / device / country"Not supported — only the host filter exists. Build a Trends insight with the relevant breakdown + filter instead
用户问题应对方案
“网站现在发生了什么?”引导用户访问
/web/live
“将实时流量筛选为
example.com
引导用户使用
/web/live
顶部的域名选择器
“展示过去30分钟内抓取我们网站的机器人”引导用户查看
/web/live
→ 机器人流量卡片
“展示本周抓取我们网站的机器人”构建上述“机器人流量细分”洞察,设置
date_from: -7d
“GPTBot访问我们网站的频率有多高?”构建“单个机器人钻取分析”洞察,将
$virt_bot_name
设为
GPTBot
“为什么Live标签页显示X,但我的仪表板显示Y?”Live标签页基于30分钟滑动窗口的事件数据;仪表板基于所选时间范围的汇总数据。除过去30分钟外,两者无法直接比较。
“给Live标签页添加日期范围选择器”Live标签页没有日期选择器——如需查看指定时间范围数据,请按照上述模式构建Trends洞察
“按浏览器/设备/国家/地区筛选实时流量”不支持该功能——仅主机筛选器可用。请构建包含对应细分维度+筛选器的Trends洞察替代

Gotchas

注意事项

  • Bot virtual properties (
    $virt_*
    ) only exist on events processed by the bot classification step. They are not retroactive — events from before the classifier shipped will not have them. Keep
    dateRange.date_from
    within the last few months for reliable bot results.
  • $http_log
    events come from server-side log capture, not from
    posthog-js
    . If a project does not emit
    $http_log
    , bots that don't run JS (most crawlers) will be invisible to the bot tiles.
  • The 30-minute window is a sliding aggregation over an in-memory buffer in the browser — refreshing the page replays the backfill HogQL, not the SSE stream. Do not interpret a brief "0" right after page load as a real drop.
  • The host filter strips the protocol — pass
    example.com
    , not
    https://example.com
    .
  • Tile order is persisted per-team in
    localStorage
    (under feature flag
    WEB_ANALYTICS_LIVE_EDIT_LAYOUT
    ). If a user's layout looks different from yours, it is not a bug.
  • 机器人虚拟属性(
    $virt_*
    )仅存在于经过机器人分类步骤处理的事件中。不具有回溯性——分类器上线前的事件不会包含这些属性。为确保机器人分析结果可靠,请将
    dateRange.date_from
    设置为最近几个月内。
  • $http_log
    事件来自服务端日志捕获,而非
    posthog-js
    。若项目未生成
    $http_log
    ,则不运行JS的机器人(大多数爬虫)将不会在机器人卡片中显示。
  • 30分钟窗口是浏览器内存缓冲区中的滑动聚合——刷新页面会重新执行HogQL回填,而非重播SSE流。请勿将页面加载后短暂出现的“0”视为真实流量下降。
  • 主机筛选器会去除协议——请传入
    example.com
    ,而非
    https://example.com
  • 卡片顺序通过特性标志
    WEB_ANALYTICS_LIVE_EDIT_LAYOUT
    按团队保存在
    localStorage
    中。若用户的布局与你的不同,这不是Bug。