自定义尺寸不适用于网络上的GA通用

时间:2015-01-19 10:16:20

标签: google-analytics

我在网站上使用此代码:

<script>
  var ga_global_dims = {"ab_product_page":"productpagev2"};
</script>
	
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  
  ga('create', 'UA-58015409-1', 'auto');
  ga('set', ga_global_dims);
  ga('send', 'pageview');
</script>

我还在属性设置中添加了此维度: enter image description here

但是,在细分中使用此维度时,我看不到任何数据。我需要查看此维度的流量和事件数量。

我做错了什么?

1 个答案:

答案 0 :(得分:1)

在您的固定电话中,请勿使用维度的名称 - 而是必须使用自定义维度的string "dimension" suffixed by the numeric index

<script>
  var ga_global_dims = {"dimension1":"productpagev2"};
</script>

所有值都通过跟踪像素的网址传输。如果您必须转移每个维度的名称,那么如果您有许多具有长名称的自定义维度,则会超过该网址的最大长度。使用索引意味着可以使用非常简单的参数(“&amp; dim1”)传输维度。

另外,在自定义尺寸的值显示之前,可能需要一段时间(我经历过最长的48小时)。

相关问题