Can i turn demographics off in Google analytics in the embed code?

we want to be able to only record demographics in google analytics if the user says it is ok to do so, as it is technically personally identifiable data. If the user says no i want to be able to still run the analytics but without the demographics bit.

On this page it shows the embed code

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ga('create', 'UA-XXXXXX-XX', '');
ga(‘require’, ‘displayfeatures’);
ga('send', 'pageview');

and says the line ga(‘require’, 'displayfeatures’); is the bit that enables the demographics. Does this mean that i can remove this as necessary to turn on or off the demographics but still track other metrics? (i know demographics needs to be turned on in the GA admin).

Obviously i can then use a cookie etc to control the users response and add or remove the line.

Would this work?


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.