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
https://www.stefanmaescher.com/google-analytics-display-features/ it shows the embed code
ga('create', 'UA-XXXXXX-XX', 'example.com');
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?