Enable Demographics and Interests reports in Universal Analytics

后端 未结 3 1382
野趣味
野趣味 2021-02-05 07:12

I want to enable demographics and interests reports with the Universal Analytics tracking code.

The generated tracking code for my site looks like this:

         


        
3条回答
  •  时光取名叫无心
    2021-02-05 07:25

    Using Demographics and Interests reports in analytics.js

    In order to enable Demographics and Interests reports in Universal Analytics, you need to alter your tracking code slightly to include a required directive:

    ga('create', 'UA-XXXXXX-XX', 'example.com');

    ga('require', 'displayfeatures'); enables Demographics and Interests reports

    ga('send', 'pageview');

    But please note that you must also update your privacy policy if you add this code! (emphasis mine)

    If you choose to support Display Advertising, you need to make a simple, one-line change to your Google Analytics tracking code. Once you have made this change, Google Analytics collects the information it normally does, as well as the DoubleClick cookie when that cookie is present. For more information about this cookie, visit the Google Advertising Privacy FAQ. When you make this update to your tracking code, you also need to update your privacy policy.

    This modification does not impact any customizations you have previously made to your code.


    Use ga.js and analytics.js simultaneously

    You can use both analytics.js and ga.js simultaneously without negatively impacting your Analytics.

    The analytics.js snippet is part of Universal Analytics, which is currently in public beta. New users should use analytics.js. Existing ga.js users should create a new web property for analytics.js and dual tag their site. It is perfectly safe to include both ga.js and analytics.js snippets on the same page.

提交回复
热议问题