我是GTM的新手,并且对Universal Analytics的解雇感到头痛 . 我遵循this step by step教程,但从未在我的Google Analytics上发生任何事件 . 如果有的话,请指出我的错误 . 这是我配置的方式:
- 配置UA id和事件参数:
{{Event Category}}
{{Event Action}}
{{Event Label}}
{{Event Value}}
是我创建的变量
这是我为 {{Event Category}}
配置的方式 . 其他配置相同 .
-
setup "fields to set" setting:
{{App Name}}
{{App Version Code}}
是预定义变量 .
-
事件触发器设置:
-
最后,这是我如何将事件推送到datalayer:
-
在初始屏幕活动时初始化 .
test_v8
是我从GTM下载的二进制文件 .
PendingResult<ContainerHolder> pending =
TagManager.getInstance(getApplicationContext()).loadContainerPreferNonDefault(CONTAINER_ID,
R.raw.test_v8);
// The onResult method will be called as soon as one of the following happens:
//1. a saved container is loaded
//2. if there is no saved container, a network container is loaded
//3. the request times out. The example below uses a constant to manage the timeout period.
pending.setResultCallback(new ResultCallback<ContainerHolder>() {
@Override
public void onResult(ContainerHolder containerHolder) {
ContainerHolderSingleton.setContainerHolder(containerHolder);
Container container = containerHolder.getContainer();
ContainerHolderSingleton.setContainerHolder(containerHolder);
ContainerLoadedCallback.registerCallbacksForContainer(container);
containerHolder.setContainerAvailableListener(new ContainerLoadedCallback());
}
}, 2, TimeUnit.SECONDS);
launchApplication();
}
- 用户点击按钮时推送事件:
dataLayer.pushEvent(“action”,DataLayer.mapOf(“category”,“test category”,“action”,“test action”,“label”,“test label”));
更新:我使用GTM V4 for Android .
1 回答
我通过删除
{{Event Value}}
配置修复了这个问题 . 将该字段留空,GTM就像魅力一样 .