ユニバーサル アナリティクスのトラッキング コードを使用して、人口統計とインタレスト レポートを有効にしたいと考えています。
私のサイト用に生成されたトラッキング コードは次のようになります。
<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-999999999-9', 'whatever.com');
ga('send', 'pageview');
</script>
Display Advertiser Featuresの下に、次のオプションがあります。
人口統計および関心レポートでは、年齢、性別、および関心のデータが利用できるため、訪問者が誰であるかをよりよく理解できます。このデータを表示するには、トラッキング コードを少し変更する必要があります。トラッキング コードを変更する方法について詳しくは、こちらをご覧ください。
リンク先: https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad
これは基本的に交換するように私に言います:
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www')
+ '.google-analytics.com/ga.js';
と:
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://')
+ 'stats.g.doubleclick.net/dc.js';
しかし、これは別のバージョンの Analytics をターゲットにしているようです (従来の Analytics トラッキング コードで、新しい Universal Analytics を使用しています)...
私はちょうど交換する必要があります:
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
何かと?(例えば)
})(window,document,'script','//stats.g.doubleclick.net/analytics.js','dc');
また、訪問者の年齢と性別を追跡するために、本当に広告主機能を有効にする必要がありますか? 現在、AdSense を使用するつもりはありません。