Google Analytics跟踪事件与维度不正确的关系

时间:2015-01-26 14:34:47

标签: google-analytics google-analytics-api google-reporting-api

我试图跟踪具有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'
                ));

结果不正确所有点击都被捆绑到一维,维度3是帖子ID。 例如,如果我点击了标识为30的帖子(维度3设置为30)和标识为10的帖子,则会报告标识为30的帖子有2次点击,或者某个较旧的标识有2次点击。

Google Analytics Dashbaord精选: enter image description here enter image description here

正如你从选秀​​中看到的,我有1行,帖子ID为2和7次点击,但我发送的事件包含许多不同的帖子ID。 (dimension3 == post id)。

1 个答案:

答案 0 :(得分:2)

这里的问题是您要将所有这些维度设置为具有用户范围。因此,每个维度每个用户只能有一个值。这对于用户ID维度很好,但对于像post id这样的维度,这可能是不正确的。据推测,用户可以查看许多帖子ID。将帖子ID设置为用户范围将导致每次看到新帖子时都会使用最新帖子覆盖帖子ID值(这就是为什么报告中只出现一个值)。相反,您希望将post id设置为具有hit的范围,这将允许在每次事件命中时发送不同的值。

你可以change the scope via the interface

详细了解custom dimension scope

相关问题