I am attempting to use Google Universal Analytics API to track events (https://developers.google.com/analytics/devguides/collection/analyticsjs/).
我尝试使用谷歌通用分析API来跟踪事件(https://developers.google.com/analytics/devguides/collection/analyticsjs/)。
Is it possible to send/force some attributes, like operating system, event timestamp, location, and so on? I can't seem to find this in the documentation.
是否可以发送/强制一些属性,比如操作系统、事件时间戳、位置等等?我在文档中找不到这个。
Thanks
谢谢
2 个解决方案
#1
0
Operating system, time down to the next minute and location (as determined by IP) is already available.
操作系统、时间和位置(由IP决定)已经可用。
And yes, you can create custom dimensions with an event hit. You need to create your dimensions in the property settings, custom definitions (set scope to hit). The dimension gets a numeric index when you create it starting from 1. In the code you use the word dimension plus the numeric index to address your dimension:
是的,您可以使用事件命中创建自定义维度。您需要在属性设置、自定义定义定义(设置要点击的范围)中创建维度。当您从1开始创建该维度时,它将获得一个数字索引。在代码中,您使用单词维度加上数字索引来表示您的维度:
ga('send', 'event', 'category', 'action', {'dimension1': "a custom value"});
Custom dimensions are not visible per default in standard reports, either select one of them as second dimension or create a custom report.
在标准报告中,自定义维度在默认情况下是不可见的,要么选择其中之一作为第二个维度,要么创建一个自定义报告。
#2
0
Google Analytics added new properties to override the IP and User-Agent, so that takes care of os name and location. Here for more info: https://github.com/brsanthu/google-analytics-java/issues/8
谷歌Analytics增加了新的属性来覆盖IP和用户代理,这样就可以处理os名称和位置。这里有更多信息:https://github.com/brsanthu/google-analytics-java/issues/8
As for the timestamp, I created a custom dimension.
至于时间戳,我创建了一个自定义维度。
#1
0
Operating system, time down to the next minute and location (as determined by IP) is already available.
操作系统、时间和位置(由IP决定)已经可用。
And yes, you can create custom dimensions with an event hit. You need to create your dimensions in the property settings, custom definitions (set scope to hit). The dimension gets a numeric index when you create it starting from 1. In the code you use the word dimension plus the numeric index to address your dimension:
是的,您可以使用事件命中创建自定义维度。您需要在属性设置、自定义定义定义(设置要点击的范围)中创建维度。当您从1开始创建该维度时,它将获得一个数字索引。在代码中,您使用单词维度加上数字索引来表示您的维度:
ga('send', 'event', 'category', 'action', {'dimension1': "a custom value"});
Custom dimensions are not visible per default in standard reports, either select one of them as second dimension or create a custom report.
在标准报告中,自定义维度在默认情况下是不可见的,要么选择其中之一作为第二个维度,要么创建一个自定义报告。
#2
0
Google Analytics added new properties to override the IP and User-Agent, so that takes care of os name and location. Here for more info: https://github.com/brsanthu/google-analytics-java/issues/8
谷歌Analytics增加了新的属性来覆盖IP和用户代理,这样就可以处理os名称和位置。这里有更多信息:https://github.com/brsanthu/google-analytics-java/issues/8
As for the timestamp, I created a custom dimension.
至于时间戳,我创建了一个自定义维度。