Warm tip: This article is reproduced from serverfault.com, please click

google analytics-使用Measurement Protocol(GA4)设置debug_mode

(google analytics - Setting debug_mode with Measurement Protocol (GA4))

发布于 2020-12-01 16:00:07

找不到使用Measurement Protocol 4设置debug_mode参数的方法想把它放到任何地方(并命名所有我能想到的),但是没有运气:)文档仍然很轻巧,没有提到debug_mode。使用web / js和GA4可以正常工作!

Questioner
bang
Viewed
11
bang 2020-12-02 07:36:50

奇怪的。突然,调试模式开始与我100%确信以前没有工作过的代码一起使用。

将参数debug_mode = true添加到测量协议4请求将使它显示在分析DebugView中。

有效的样本json有效负载:

{
  client_id: 'XXXXXXXXXX.YYYYYYYYYY',
  events:
  [{
    name: 'page_view',
    params:
    {
      page_location: '....',
      page_path: '....',
      page_title: '....',
      debug_mode: true
    }
  }]
}