在Google Analytics跟踪代码中设置安全参数

时间:2015-05-28 16:35:30

标签: javascript ruby-on-rails cookies https google-analytics

我正在尝试在Google Analytics Cookie中设置 secure = true :utma,utmb,utmc,utmz,utmv y utmx就像我在Rails应用中所做的那样:

cookies [:web] = {:value => 'XXXXXXXX',:secure =>是的}

我应该更改下一个Google Analytics跟踪代码吗?有可能吗?

<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXXX']);
    _gaq.push(['_trackPageview']);
    (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>

1 个答案:

答案 0 :(得分:1)

不。我认为您无需更改Google Analytics跟踪代码。