用于事件的Google Analytics屏幕名称 [英] Google Analytics screenname for events

查看:130
本文介绍了用于事件的Google Analytics屏幕名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Google Analytics中的屏幕名称维感到困惑。



如果进入行为 - >事件 - >屏幕,您会看到它。

我想知道如何将一个屏幕名称附加到一个事件上。目前我正在跟踪屏幕视图(点击)和事件(点击)。我认为分析可以通过查看上一个屏幕视图来获取事件的屏幕名称。但这似乎并不是这种情况。



顺便说一句,我正在使用Measurement Protocol。



对此有何看法?

解决方案


<我认为分析可以通过查看上一个屏幕视图来获取事件的屏幕名称。但这似乎并不是这样。


不,情况并非如此。您发送给Google Analytics的所有数据的范围为可以是 User Session 或者 Hit (每个匹配属于一个会话,每个会话属于一个用户) / p>

对于用户级别的数据(例如客户端ID ),Google Analytics 能够将该数据应用于该用户的所有会话和所有匹配,但在屏幕名称和事件数据(例如活动类别事件动作),这些都是范围到命中级别,因此只适用于他们发送的命中。



大多数跟踪库(包括analytics.js以及Android和iOS SDK)具有跟踪器的概念,这是一个对象可以通过衡量协议存储数据并将数据发送给Google Analytics。

如果您想将特定的屏幕名称与用户在特定屏幕上时发生的所有事件相关联,则需要将该屏幕名称与所有事件命中也是如此。为方便起见,跟踪器对象允许您 set 的数据,然后这些数据会随后发送,因此在您的情况下,您希望在发送任何事件匹配之前在跟踪器上设置屏幕名称。



以下是使用analytics.js的示例实现:

  ga('create ','UA-XXXXX-Y','auto'); 

//为此
//以及所有后续命中设置`screenName`字段为主屏幕。
ga('set','screenName','Home Screen');

//发送一个screenview命中主屏幕
ga('send','screenview');

//发送一个事件命中。由于`screenName`字段在跟踪器上已经设置了
//,因此该命中的数据也会被发送
//。
ga('send','event','Navigation Links','click','/ about');

注意:所有链接均属于analytics.js文档页面,但概念也适用于Android和iOS SDK。


I'm confused about the "Screen Name" dimension in Google Analytics.

If you go to Behaviour -> Events -> Screens you'll see it.

I'm wondering how you can attach a screen name to an event. Currently I'm tracking screenview (hits) and event (hits). I thought analytics could get the screenname for an event by looking at the last screenview. But this doesn't seem to be the case.

Btw I'm using the Measurement Protocol.

Any ideas on this?

解决方案

I thought analytics could get the screenname for an event by looking at the last screenview. But this doesn't seem to be the case.

No, this is not the case. All data you send to Google Analytics is scoped to either a User, a Session, or a Hit (where every hit belongs to a session, and every session belongs to a user).

For user level data (e.g. client ID), Google Analytics is able to apply that data to all session and all hits for that users, but in the case of screen name and event data (e.g. event category and event action), these are all scoped to the hit level and therefore only apply to the hit they are sent with.

Most of the tracking libraries (including analytics.js and the Android and iOS SDKs) have the concept of a tracker, which is an object that can store data and send data to Google Analytics via the Measurement Protocol.

If you want to associate a particular screen name with all events that occurred when the user was on that particular screen, you'd need to send that screen name with all event hits as well. For convenience, the tracker objects allow you to set data on them, and then that data will get sent with all subsequent hits, so in your case you'd want to set the screen name on the tracker before sending any event hits.

Here's an example implementation using analytics.js:

ga('create', 'UA-XXXXX-Y', 'auto');

// Sets the `screenName` field to "Home Screen" for this
// and all subsequent hits.
ga('set', 'screenName', 'Home Screen');

// Sends a screenview hit for "Home Screen"
ga('send', 'screenview');

// Sends an event hit. Since the `screenName` field was
// already set on the tracker, that data will get sent
// with this hit as well.
ga('send', 'event', 'Navigation Links', 'click', '/about');

Note: all links are to analytics.js documentation pages, but the concepts apply to the Android and iOS SDKs as well.

这篇关于用于事件的Google Analytics屏幕名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆