Google analytics google anlytics用于设置自定义变量的新版本

Google analytics google anlytics用于设置自定义变量的新版本,google-analytics,google-analytics-api,Google Analytics,Google Analytics Api,这是我的新分析代码: <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.

这是我的新分析代码:

<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-000000-0', 'mysite.com');
  ga('send', 'pageview');

</script>
]))

但是变量“_gaq”没有定义,我应该把代码放在哪里?
我的分析就在标签后面

Universal analytics没有push。它有一个ga()函数

通用分析中也没有自定义变量。在Universal Analytics中,我们可以定制维度和指标。

您的自定义变量与新的自定义维度几乎相同

主要区别在于它们是在GA接口中设置的,而不是通过旧的.push函数的参数设置的

ga('set','dimension1','Yes')


通用分析中没有自定义变量(也没有gaq变量),谷歌将其改为“自定义dimenson”。可能找到了重复的变量,谢谢。你知道这些过滤器是否适用于实时用户报告吗?好问题,我不确定你是否能在实时报告中看到自定义维度和指标。我刚刚检查了一些我可以访问的站点,但它并不意味着你可以从realitime报告中访问自定义维度信息。此外,实时api也不允许您导出信息。
_gaq.push(['_setCustomVar',
  1,                   // This custom var is set to slot #1.  Required parameter.
  'Items Removed',     // The name acts as a kind of category for the user activity.  Required parameter.
  'Yes',               // This value of the custom variable.  Required parameter.
  2                    // Sets the scope to session-level.  Optional parameter.