问题描述
当我向Google Analytics(分析)发送事件时,它会实时显示。但是在“行为事件”标签中不可用(即使3天后)。因此,我无法在报告中使用它。
const ua = require("universal-analytics");
const config = require("../config");
const analytics = ua("UA-1xxxxxxx-x","ae21bb3e-0e53-4054-89d6-a5bbecc485e7",{
requestOptions: {
proxy: config.externalHttpProxy
}
});
analytics.event(
{
"eventCategory": "Team","eventAction": "ADD_USER_TO_TEAM","cd1": "team-new","cd3": "user1","cd4": "2020-09-02T17:07:48","cd5": "30"
},err => {
if (err) {
log.error("Error occurred while sending event to ga",err);
}
}
);
我在这里错过了什么吗?
解决方法
尝试将文档位置URL参数(dl)添加到事件匹配项:https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#dl
,一旦取消选中视图设置中的“自动筛选”复选框,所有这些事件都会在12小时后开始显示在“行为事件”标签中。
注意:每个会话最多只能发送500个事件。如果我们发布500个以上的事件,则不会处理这些事件。因此,它不会在“行为”标签中显示。