This can be accomplished by leveraging the current functionality of the setting ‘Enable EU compliance’ within the settings for the integrated analytics tool. With this setting enabled, the system will check for the presence of the cookie ‘sat_track’ when the page loads and will then load the analytics tool based on the following logic:
- If the cookie does not exist or if the cookie exists and is set to anything but true, the loading of the tool is skipped, meaning any portion of a rule that uses the analytics tool will not apply.
- If a rule has analytics with EU compliance on and third-party code, and the cookie is set to false, the third-party code still runs; however, the analytics variables will not be set.
- If the cookie exists but it is set to true, the tool loads normally.
The DTM user is responsible for setting the ‘sat_track’ cookie to false if a visitor opts out; so, this could easily be configured to set based on some other variable if desired. So, for example, with EU compliance enabled for the installed tool, you could configure a top of page, page load rule to fire when certain countries are detected (for example) and then set the ‘sat_track’ cookie to false in the rule trigger using the following custom code: _satellite.setCookie(“sat_track”, “false”);