查看 Google 分析事件值

View Google Analytics event value

我正在使用 GA 来跟踪 Android 应用程序的事件。

我以通常的方式跟踪事件:

t.send(new HitBuilders.EventBuilder()
.setCategory(getString(categoryId))
.setAction(getString(actionId))
.setLabel(getString(labelId))
.setValue(longValue)
.build());

我可以在我的报告中看到该事件,但我只能看到该事件发生的总金额。我怎样才能看到我发送的所有值的故障?

你不能。这不是 value 参数的目的。它意味着一个度量标准(您在报告右侧看到的内容,即相加的内容)。如果您想单独查看这些值(作为一个维度),您将不得不重组您发送的内容以将其包含在 categoryactionlabel 中。

更新:

But I DO want to use them as a metric. I want to create a custom report with these values as metrices and with another custom dimension I have created. I even asked about it in another question here: whosebug.com/questions/30213318/…

好的,我认为您误解了维度和指标之间的区别。维度告诉您“什么”,例如发生了什么事件或查看了什么项目。一个指标告诉你“数量”,例如事件发生了多少次或视频被消耗了多少。

因此,您将一个特定数字作为事件的 value,这是一个 指标 ,但您希望查看您发送的各个值in. 那不是指标的作用。如果您想查看单独的数字,这就是为什么我说您需要重组发送这些值的方式。您需要将它们作为 categoryactionlabel然后你就可以为所欲为了,例如:

Let's say I'm creating a custom report or a dashboard. There I can choose the dimension and metrices I want. Is there a way to somehow choose a regular event as the metric? Let's say I got an event with the label "label1" then I want a report with a dimension of date and a metric "label1". Is that possible?

然后您可以选择日期作为维度,然后选择 categoryactionlabel 作为第二维度。这将向您显示在给定日期发生了多少次。或者你可以翻转它,例如使用 category 作为主要维度,然后将日期作为第二维度,它会按日期显示细分。

但是您不能将 categoryactionlabel 放在 metrics 列中。那没有意义。如前所述,指标向您显示 如何 many/much 的维度。唯一的例外是事件的 value 部分, 一个指标。但是指标列不会向您显示单独的值。您可以阅读更多关于 value 如何出现在报告中的信息,here

Value 是为了给维度赋值,例如建立重要性顺序。例如,如果您有一个注册系统,并且访问者可以注册免费或高级帐户,那么从转换 PoV 来看,高级注册对您来说更有价值。所以例如您可以为免费注册事件赋予值 1,但为高级注册事件赋予值 2。

或者,它可以用于其他方面,例如录制视频所消耗的时间,例如每隔 5 秒播放一次视频,您就会弹出一个带有值的事件,例如视频、一些视频名称、消耗的时间和值 5。然后您可以使用该值度量来查看给定视频消耗的时间,例如 total/avg。

TL;DR: 给定的事件将让您发送 3 个维度(categoryactionlabel)和一个公制 (value) 给它 weight/amount。您正试图将 value 当作一个维度来使用,但实际上它不是。您还试图将维度用作指标,但实际上并非如此。我认为你真正想要的是将一个维度(如"Date")分解为另一个维度(如category),你还需要弄清楚如何将您当前放入 value 的内容记录为维度参数之一。

更新#2:

I was actually thinking of dimensions and metrices as an SQL table where the dimensions are the primary keys and the metrices are the regular column which will hold the value I will give it when I'm sending the metric. So I wanted to see for example the dimension date and a user id which can not repeat itself and in the metrices columns just see every value I sent.. so it's actually wrong you say.

最终所有内容都存储在数据库中,是的,但是请注意,它就像一个直接的、单一的 table 一样简单,带有条目,带有简单的查询。在分析方面要复杂得多。

如果我将它与 SQL Table 进行比较,那么维度(categoryactionlabel)将是列。然后每一行都代表一个命中(你触发一个事件的地方),并且有它们的值,例如

Category       Action       Label
Some Category  Some Action  Some Label
Some Category  Some Action  Some Label
Category 2     Some Action  Some Label

现在,db/table 结构看起来完全不是这个样子。它被分解成几个 tables 等。但为了举例,这就可以了。

另一方面,现在指标更像是假设您使用 Category 作为维度,并且只想查看记录类别值的次数。所以(再次,超级简化它),它看起来像这样:

select Category,count(Category) as `Total Events` from Table group by Category

因此,在 SQL 结果中,您的行会显示 Category 值,"Total Events" 会显示每个值的总和,例如

Category            Total Events
Some Category       2
Category 2          1

因此 "Category" 结果列是一个维度,而 "Total Events" 结果列是一个指标。所以当你说例如"I want to use Label as a metric" 嗯,这没有意义,因为它试图获取 "Some Category" 之类的值并在聚合上下文中使用它,例如"Some Category" + "Category 2" = ?? 没有意义!

因此,如果您想查看在 Value 中传递的各个值,您需要将其作为 CategoryAction 或 [= 中的值进行跟踪43=](或者,您可以为您的事件设置一个自定义变量),然后将其作为一个维度添加到您的报告中。