Google分析 - 如何发送自定义维度/指标的值 [英] Google analytics - How to send values for custom dimension/metrics

查看:262
本文介绍了Google分析 - 如何发送自定义维度/指标的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从google analytics开始,我不知道它是如何工作的。



我们正在创建一个网站,我们希望将用户名添加为自定义变量在谷歌分析,以分析每个用户与网站的行为。



为此,我开始使用谷歌分析(analytics.js)几个星期之前,我创建了一个自定义维度(了解用户的访问权限)和自定义指标(以了解有多少次访问),如文档中所示。



维度和指标是使用会话范围创建的,因为这些值必须在每个会话中发送一次。



After那么,我添加了所需的代码,如此处 a>:

  ga('create','UA  -  #######  -  1','domain。 COM); 
$ b ga('set',{
'dimension1':'userName',
'metric1':1
});

ga('send','pageview');

我试过这段代码和其他配置,但谷歌分析没有采用这些值。
看这张图片( http://snag.gy/Ou8vG.jpg



我做得不好?它可能是因为我发送请求'pageview'和维度的范围与会话?

解决方案

最后工作! !

显然,在Google开始记录信息之前,您必须等待一段时间(比如2天)。文档没有详细说明。



我希望这个答案可以帮助其他人提出同样的问题!!


I'm starting with google analytics and i don't realize how make it works.

We are making a site and we want to add the user name as custom variable in google analytics in order to analyze the behavior of each user with the site.

For this, i start to use google analytics (analytics.js) a couple weeks ago and i created a custom dimension (to know who user access) and a custom metric (to know how many visits made) as it's indicated in documentation.

The dimension and metric were created with session scope because those values must be sent once per session.

After that, i add the code needed as is explained here:

ga('create', 'UA-#######-1', 'domain.com');

ga('set', {
  'dimension1': 'userName',
  'metric1': 1
});      

ga('send', 'pageview');

I've tried this code and others configurations but google analytics doesn't take the values. Look this image (http://snag.gy/Ou8vG.jpg)

What i'm doing bad? it can be because i'm sending the request with 'pageview' and the dimension is scoped with session?

解决方案

Finally worked!!

Apparently you must wait a time (like 2 days for me) before Google starts to record the information. Documentation not specified this detail.

I hope this answer helps other people with the same question!!

这篇关于Google分析 - 如何发送自定义维度/指标的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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