Google analyticsで2つのアカウントをセットする方法

javascriptの記述メモ
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-●●●●-●']);
  _gaq.push(['_trackPageview']);

  _gaq.push(['second._setAccount', 'UA-▲▲▲▲-▲']);
  _gaq.push(['second._trackPageview']);
  _gaq.push(['second._setDomainName', 'none']);
  _gaq.push(['second._setAllowLinker', true]);

  (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);
  })();
Spread the love
2016.12.17(土)