使用 Measurement Protocol 发送的事件不会设置活跃用户

问题描述

我正在尝试使用 Measurement Protocol V4 将事件从 Telegram bot(Java 后端)发送到 Google Analytics。该事件目前看起来像这样:

{
    "client_id": "<telegram_chat_id>","events": [
        {
            "name": "tg_bot_command","params": {
                "command_type": "HELP"
            }
        }
    ]
}

发送事件后,我在实时概览页面的“按事件名称的事件计数”卡片中看到该事件及其属性,但client_id属性无处可见。并且“过去 30 分钟内的用户”卡片仍为空。 我还尝试将 user_id 参数添加到事件中,但也没有效果

如何发送这些事件,以便它们显示用户处于活动状态?

G-Analytics page showing logged events,but no users

解决方法

解决方案:在事件属性中添加engagement_time_msec

enter image description here