Universal Analytics - 为一个维度和一个综合浏览量推送多个值 [英] Universal Analytics - push multiple values for one dimension and one pageview

查看:21
本文介绍了Universal Analytics - 为一个维度和一个综合浏览量推送多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 google 通用分析及其自定义维度.

在一页上,我想为一个(并且只有一个)维度发送多个值.

我试过:

ga('send', 'pageview', {'dimension1': '脾气暴躁的猫'})ga('send', 'pageview', {'dimension1': 'happy cat'})

当我使用 google API 时,我可以为我的维度 1 获取我刚刚发送的所有值 - 所以它运行良好.

但是我认为(我不确定)我不应该多次发送同一页面上的综合浏览量命中,因为这会破坏综合浏览量指标.

所以我尝试使用自定义指标(页面浏览毕竟是一个指标):

ga('send', 'metric1', {'dimension1': '脾气暴躁的猫'})ga('send', 'metric1', {'dimension1': 'happy cat'})

但是这个根本行不通:(似乎 ga.('send'... 只接受 pageview 但这很奇怪(如果它是唯一可能的价值?)

我该如何解决我的问题?这只是一个语法问题,自定义维度/自定义指标不可能吗?我真的可以使用 pageview 来做到这一点吗?我应该使用自定义事件而不是那个吗?

谢谢!

* 编辑 *

我实际上发现我可以使用带有如下标签的事件:

ga('send', 'event', 'cat', 'view', 'grumpy')ga('send', 'event', 'cat', 'view', 'happy')

(如果有人可以确认或有评论,我会很高兴)

解决方案

不久前我遇到了类似的问题.问题是,在 Google Analytics (GA) 和 Universal Analytics (UA) 中,您无法将多个值推送到单个自定义变量(维度或指标).当您将多个值推送到单个页面(或会话或用户,取决于自定义变量、维度或指标的范围,如果您使用 UA)的自定义变量、维度或指标时会发生什么最后报告的值是唯一记录的值.最后一个值会覆盖先前设置的值.因此,您尝试为自定义变量(或维度)记录具有 2 个不同值的两次综合浏览量.

在你的例子中,假设一个人在包含两个类别后加载了一个搜索结果页面,grumpy cathappy cat,并且你想将它们都记录在通过报告变量(或维度)两次来自定义变量或维度,如果您按照您提到的顺序发送它们,

ga('send', 'pageview', {'dimension1': '脾气暴躁的猫'});ga('send', 'pageview', {'dimension1': 'happy cat'});

您只是在记录两种不同的综合浏览量(这会以无数种方式扭曲您的报告,具体取决于您可能拥有的数量或类别).例如,如果一个人访问超过 5 个类别,您将有重复的综合浏览量,并且您在页面上的时间将大大减少,因为根据 UA(或 GA),这些综合浏览量(最后一个除外)会持续更少不到一秒.

此外,您想要链接到这些自定义变量(或维度)的任何事件只会链接到最后推送的网页浏览量或自定义变量(或维度).例如,如果您设置了一个事件跟踪来确定有多少人与搜索结果进行了交互,并且您想按类别进行过滤(在您现在的情况下为 dimension1),以了解如何当 dimension1 等于 grumpy cat 时,许多人与页面进行了交互,您将得到 0,因为只会为具有 ddimension1 等于 happy cat 因为那是 GA(或 UA)认为用户在触发事件时一直在查看的页面,并且该页面仅将 dimension1 设置为 <代码>快乐猫.由于这两个调用是 async,您实际上永远无法知道事件是否发送到您认为它去的网页浏览,即使我解释过也是如此.

记录此类数据的更好方法是使用 url 编码的类别名称、空格分隔,并在列表末尾附加一个空格.例如,您必须将综合浏览量发送为

ga('send','pageview',{'dimension1':'grumpy-cat happy-cat '});

或者更好,如,

ga('set',{'dimension1':'grumpy-cat happy-cat '});ga('发送','浏览量');

还要注意末尾的空格.这个额外的空间允许您使用 reg-ex s 根据自定义变量过滤任何报告.例如,要了解有多少人查看了 Grumpy Cat 类别的页面,您将过滤报告,使 dimension1 与正则表达式 grumpy-cats 匹配.我已经使用 - 转义了正则表达式中的 - 字符,而 s 代表空白字符.好消息是,这样的报告将获取您所有的综合浏览量(或您想查看的任何内容),那些只有 grumpy cat 作为类别名称的,以及那些具有 的页面页面所属的类别中的脾气暴躁的猫.

添加子类别的一种方法是将维度作为 cat1 cat1-subcat1 cat1-subcat2 cat2 cat2-subcat1 发送,这样正则表达式 cat1s 将处理所有类别级别的页面,而正则表达式 cat1 将处理所有具有类别 cat1 或具有属于 cat1 的子类别的页面.

希望有所帮助.:)

顺便说一句,使用事件来查看包含类别的页面并不是记录它的好方法.因为,如果您分配维度(这也是引入自定义维度的原因之一,因为不同的站点有不同的类别,而 Google 无法命名所有),您的事件也会携带页面的维度,这很有帮助确定哪些类别需要什么,只需按您的情况dimension1 对您的报告进行细分.例如,您将了解哪个类别的 SEO 访问量最高,哪个类别的转化率最高,等等.祝分析愉快!:)

I am trying to use google universal analytics and its custom dimensions.

On one page, I want to send multiple values for one (and one only) dimension.

I tried:

ga('send', 'pageview', {'dimension1': 'grumpy cat'})
ga('send', 'pageview', {'dimension1': 'happy cat'})

When I use google API, I can get for my dimension1 all the values I just sent - so it works well.

However I think (I am not sure about it) that I should not send several times a pageview hit on the same page because it would disrupt the pageview metric.

So I tried to use a custom metric (pageview is a metric after all):

ga('send', 'metric1', {'dimension1': 'grumpy cat'})
ga('send', 'metric1', {'dimension1': 'happy cat'})

But this one doesn't work at all :( It seems ga.('send'... only accepts pageview but it is weird (why specify pageview in the arguments if it is the only value possible?)

How can I solve my problem? Is it just a syntax issue, is it not possible with custom dimension / custom metric? Can I actually use pageview to do it? Should I use custom events instead of that?

Thank you!

* edit *

I actually found out that I may use an event with a label like:

ga('send', 'event', 'cat', 'view', 'grumpy')
ga('send', 'event', 'cat', 'view', 'happy')

(If anyone can confirm it or have comments I would be happy with that)

解决方案

I had a similar problem a while back. The thing is, you cannot push multiple values to a single custom variable (dimension or metric) in both Google Analytics (GA) and Universal Analytics (UA). What happens when you push more than one value to a custom variable, dimension, or metric for a single page (or session or user, depending upon the scope of the custom variable, dimension or metric, if you're using UA) is that the last reported value is the only one that is recorded. The last value overrides the previously set value. So, you have tried to record two pageviews with 2 different values for your custom variable (or dimension).

In your case, say a person loads a search results page after having included two categories, grumpy cat and happy cat, and you want to record both of them in a custom variable or dimension by reporting the variable (or dimension) twice, and if you send them in the order you mentioned,

ga('send', 'pageview', {'dimension1': 'grumpy cat'});
ga('send', 'pageview', {'dimension1': 'happy cat'});

you are simply recording two different pageviews (which will skew your reports in innumerable ways, depending on the number or categories you may have). For example, if a person visits more than 5 categories, you will have duplicate pageviews, and your time on page will be drastically reduced, as according to UA (or GA) these pageviews (except for the last one) would have lasted for less than one second.

Also, any events you wanted to link to those custom variables (or dimensions), would only be linked to the last pushed pageview or custom variable (or dimension). As an example, if you had an event tracking set up to identify how many people interacted with the search results, and if you then wanted to filter by category (dimension1 in your case now), to know how many people interacted with the page when dimension1 equals grumpy cat you would get 0, as the events would have only been recorded for the pageview with ddimension1 equal to happy cat because that was the page which GA (or UA) thinks the user had been viewing when firing the event, and that page only had dimension1 set to happy cat. Since those two calls are async, you would actually never be able to know if the events were sent to the pageview you think it went to, even as I explained.

The better way to record this type of data would be to use url-encoded category names, space separated, and a space appended to the end of the list also. As an example, you must send the pageview as,

ga('send','pageview',{'dimension1':'grumpy-cat happy-cat '});

or better, as,

ga('set',{'dimension1':'grumpy-cat happy-cat '});
ga('send','pageview');

Note the space at the end also. This extra space allows you to filter any report based on the custom variable using the reg-ex <categoryName>s. As an example, to find out how many people viewed a page with category Grumpy Cat, you will filter your report such that the dimension1 matches regex grumpy-cats. I have escaped the - character in regex using -, and s stands for a whitespace character. The good thing is, such a report will fetch you all pageviews (or whatever you want to look at), those with only the grumpy cat as category name, as well as those pages which have grumpy cat in the categories to which a page belongs.

A way to add subcategories is to send dimensions as cat1 cat1-subcat1 cat1-subcat2 cat2 cat2-subcat1 so that the regex cat1s will take care of all category level pages, whereas the regex cat1 will take care of all pages which have category cat1 or which have a subcategory belonging to cat1.

Hope that helps. :)

On a side note, using events for views of a page containing a category is not a nice way of recording it. Because, if you assign dimensions (and this is one of the reasons why custom dimensions were introduced, as different sites have different categories and Google can't name all), your events will also carry the dimensions of the page and it helps a lot to identify which categories are in need of what, by simply segmenting your reports by, in your case, dimension1. For example, you will get to know which category has highest SEO visits and which has the best conversion rates, and stuff. Happy analysing! :)

这篇关于Universal Analytics - 为一个维度和一个综合浏览量推送多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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