Consent Managers – Basic Integration

This document describes how to perform a basic integration between your Consent Manager and Webtrends Optimize.

Skill level required: developer, basic

What is the basic integration?

This integration describes how to block Optimize from running if users have not given consent.

The way we approach it is exactly that – you still run the Optimize tag, but we abort all tests from being fetched/attempted/tracked if users have not yet consented.
The evaluation of whether or not to run is performed once per page load – if your consent manager triggers a refresh on opt-in, this works very well with it.

Step 1: Detecting opt-in status

We must develop knowledge of opt-in status prior to the wt.js tag triggering. Usually, there is a cookie which you can check.

Let’s take this as our example – using the Optanon consent cookie:

To detect that we have this cookie, with the value containing “C0002:1”, we can simply write:
WT.helpers.cookie.get('OptanonConsent').match("C0002:1");

Step 2: Aborting Optimize under this condition

With the condition established, aborting Optimize is easy.

At the very top of your preinit script, simply write:

var optanoncookie = WT.helpers.cookie.get('OptanonConsent'); 
if(!optanoncookie || !optanoncookie.match("C0002:1")){
   WT.optimizeModule.prototype.abort();
}