我正在尝试发送一些特定数据,以便稍后在使用GA核心api时进行过滤。例如,当我跟踪事件时,我可以传递一些参数。
ga('send', 'event', {
eventCategory: data.category,
eventAction: data.action,
eventLabel: data.label || null,
eventValue: data.value || null,
nonInteraction: data.interaction === false ? false : true
});
我可以在以后对数据进行请求时对其进行过滤。特别是我正在尝试跟踪我存储在eventLabel
字段中的项目ID。对于活动,一切都很好。
我遇到问题的部分是过滤页面视图,会话等。对此的调用如下:
ga('set', 'page', data.path);
ga('send', 'pageview', {eventLabel: 'test'});
在这种情况下eventLabel
似乎不起作用。我不能使用pagePath
过滤器,因为我正在使用漂亮的网址。如果可能,我需要在页面视图中显式设置id。或者一些有效的替代方法。
答案 0 :(得分:0)
eventLabel
命令不会引用title
参数,只会引用location
,page
或data.interaction
,如此处所述{{3} }。也许尝试使用项目ID的自定义维度。
此外,可能需要仔细检查您的事件的非交互逻辑。如果nonInteraction
为假,我认为这意味着它不是交互式的,因此buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
为真(反之亦然)。