谷歌分析核心报告api综合浏览标签?

时间:2016-07-15 05:28:31

标签: javascript google-analytics google-analytics-api

我正在尝试发送一些特定数据,以便稍后在使用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。或者一些有效的替代方法。

1 个答案:

答案 0 :(得分:0)

eventLabel命令不会引用title参数,只会引用locationpagedata.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 } } 为真(反之亦然)。