Google AnalyticsGoogle AnalyticsSEO/AEO

GA4 realtime active users by page, source, country

google-analytics.realtime

See who is on your site right now (active users by page, source and country)

价格
free按目录价
成功率
100%近 30 天 · 1,086 次
延迟 p50
368 毫秒p95 572 毫秒
最后验证
2026年7月28日实测可用
POSThttps://toolswitch.dev/v1/tools/google-analytics.realtimeBeta
  • 可用平台额度调用
  • 同步返回
  • 读取公开数据

参数

covers the last 30 minutes only, and takes NO dateRanges — passing one is an error. Reusing a standard-report dimension name here is the usual failure

参数类型必填说明示例
路径参数
property_id字符串必填123456789
请求体(JSON)
limit整数可选20
metrics数组必填activeUsers, screenPageViews, conversions[{"name":"activeUsers"}]
dimensions数组可选realtime has its OWN smaller dimension set — unifiedScreenName, country, deviceCategory, audienceName; pagePath is not among them[{"name":"unifiedScreenName"}]
minuteRanges数组可选windows within the last 30 minutes, e.g. [{"startMinutesAgo":29,"endMinutesAgo":0}]
  • 路径参数
  • property_id字符串必填

    示例:123456789

  • 请求体(JSON)
  • limit整数可选

    示例:20

  • metrics数组必填

    activeUsers, screenPageViews, conversions

    示例:[{"name":"activeUsers"}]

  • dimensions数组可选

    realtime has its OWN smaller dimension set — unifiedScreenName, country, deviceCategory, audienceName; pagePath is not among them

    示例:[{"name":"unifiedScreenName"}]

  • minuteRanges数组可选

    windows within the last 30 minutes, e.g. [{"startMinutesAgo":29,"endMinutesAgo":0}]

代码示例

将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。

Beta
curl -X POST 'https://toolswitch.dev/v1/tools/google-analytics.realtime' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{"limit":3,"metrics":[{"name":"activeUsers"}],"dimensions":[{"name":"country"}]}'

网关接口为 Beta,地址与鉴权方式可能变更。 示例参数仅为样例数据。 调用按 free 计费,已含服务费。