Google Analytics(分析)_setCustomVar - 我的信息中心中的奇怪数据 [英] Google Analytics _setCustomVar - strange data in my dashboard

查看:133
本文介绍了Google Analytics(分析)_setCustomVar - 我的信息中心中的奇怪数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的网站设置了_setCustomVar,如下所示:

 < script type =text / javascript > 

var _gaq = _gaq || [];
_gaq.push(['_ setAccount','UA-XXXXX']);
_gaq.push(['_ setDomainName','.blog4ever.com']);
_gaq.push(['_ trackPageview']);
_gaq.push(['_ setCustomVar',1,'B4E_Type_Pub','Silver_ou_Gold',3]);
_gaq.push(['_ setCustomVar',2,'B4E_Etat_Blog','normal',3]);

(function(){
var ga = document.createElement('script'); ga.type ='text / javascript'; ga.async = true;
ga .src =('https:'== document.location.protocol?'https:// ssl':'http:// www')+'.google-analytics.com / ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga,s);
})();

< / script>

在我的仪表板中,当我进入:访问者 - >自定义变量时,我看到了2个变量,但这些数字真的很奇怪(比如40页的浏览量,尽管我有几千页的浏览量)。



我已经安装了2天。



是否有人面临同样的问题?

解决方案



您需要在_trackPageview之前调用 _setCustomVar 。否则, _trackPageview 调用会将数据发送到Google Analytics,之后才会设置自定义变量。如果您在 _trackPageview 之后设置 _setCustomVar ,则自定义变量数据不会附加,并且如果没有其他<$在该浏览视图中设置了c $ c> __ utm.gif 点击次数,这些数据基本上都没有了。



(这些记录的40个综合浏览量可能会通过页面浏览量加载后发送数据的其他页面GA呼叫进行跟踪)。


I have set up the _setCustomVar for my website, like this:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX']);
  _gaq.push(['_setDomainName', '.blog4ever.com']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_setCustomVar', 1, 'B4E_Type_Pub', 'Silver_ou_Gold', 3]);
  _gaq.push(['_setCustomVar', 2, 'B4E_Etat_Blog', 'normal', 3]);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

In my dashboard, when I go in: Visitors -> Custom variables, I see my 2 variables but the numbers are really strange (like 40 pages views although I have many thousands pages views).

I have it installed for 2 days now.

Did somebody face the same problem?

解决方案

You're lucky even 40 pageviews recorded these variables.

You need to call _setCustomVar before _trackPageview. Otherwise, the _trackPageview call sends the data to Google Analytics, and only after that are the custom variables set. If you set the _setCustomVar after the _trackPageview, the custom variable data doesn't attach, and if no other __utm.gif hits are set during that pageview, the data is basically gone forever.

(Those 40 pageviews that recorded probably were tracked via some other on-page GA calls that are sending data after the pageview loads).

这篇关于Google Analytics(分析)_setCustomVar - 我的信息中心中的奇怪数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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