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

Events sent with Measurement Protocol do not set active users

我正在尝试使用 Measurement Protocol V4 将事件从 Telegram 机器人(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添加到事件属性