我试图跟踪一个具有3个维度(用户ID,小部件ID,帖子ID)的事件。每个点击事件必须在其自己的行中包含唯一的帖子ID,用户ID和小部件ID,以便我可以跟踪每个帖子的点击次数。附加:所有尺寸均设置为“用户”范围。
ga('send', 'event', 'widget', 'click', 'uwp',
{
'dimension1': $user_id,
'dimension2': $widget_id,
'dimension3': $post_id
}
);
我稍后使用报告API进行查询。
$result = Analytics::query(
$start_date,
$end_date,
'ga:totalEvents',
array(
'dimensions' => 'ga:dimension3,ga:pagePath,ga:date,ga:eventAction',
'sort' => '-ga:date',
'filters' => 'ga:eventAction==click;ga:eventLabel==uwp;ga:dimension1=='.$user->id,
'max-results'=> '100'
));
结果不正确,所有点击均被捆绑为1个维度,即维度3为发布ID。例)如果我单击ID为30的帖子(dimension3设置为30)和ID为10的帖子,则会报告ID 30的帖子获得2次点击或某些较旧的ID进行2次点击。
Google Analytics Dashbaord选择:
As you can see from the pick i have 1 row with post id of 2 and 7 clicks, yet i sent events with many different post ids. (dimension3 == post id).
The problem here is that you are setting all of these dimensions to have a scope of user. Because of this, each dimension can only have one value per user. This is fine for the user id dimension, but for a dimension like post id, this is likely incorrect. Presumably, a user can view many post ids. Setting post id to user scope will cause the post id value to be overwritten with the latest post each time a new post is seen (which is why only one value is appearing in your report). You'll instead want to set post id to have a scope of hit, which will allow a different value to be sent on each event hit.
You can change the scope via the interface.
阅读有关自定义维度范围的更多信息。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句