Skip to main content
All CollectionsObservePoint Custom Tag
OP Custom Tag - Setting up Do Not Sell/Share Links
OP Custom Tag - Setting up Do Not Sell/Share Links
Luiza Gircoveanu avatar
Written by Luiza Gircoveanu
Updated over 3 months ago

Overview

Data Privacy laws require most websites to allow users to easily opt out of having their information sold or shared. This opt-out process must be readily accessible on all pages of the website. To check for pages missing the opt-out you’ll need a little setup using what we call the ObservePoint Custom Tag.

Note: Please use the verbiage that best applies to your website, we have put Do Not Sell/Share as a generic placeholder. For the best results, you will need to update this to whatever verbiage your website uses.

Follow these steps to set up an Audit to look for your opt-out mechanism.

  1. Create a simple Audit to scan pages on your website.

  2. Update the text UPDATE ME in the code box below. Note, you can add multiple text strings to look for. Simply separate each by a comma and don’t forget to wrap them with quote marks.

  3. Add key words to this array (separated by commas)

var words = ["UPDATE ME", "UPDATE OR REMOVE ME"]; 
var tagAccountName = 'Do Not Sell';

//////////////////////////////////////////////////////////////////////////
/*
DON'T MODIFY ANYTHING BELOW
*/
//////////////////////////////////////////////////////////////////////////

var obj = {};
var dom = document.documentElement.innerText.toLowerCase();

words.forEach((word) => {
if (dom.includes(word.toLowerCase())) {
obj[word.toLowerCase()] = true;
} else {
obj[word.toLowerCase()] = false;
}
})
opReqGetAsync(obj, tagAccountName);

function opReqGetAsync(paramObject, acct, callback) {
var baseURL = window.location.protocol + "//" + window.location.hostname + "/observepointcustomtag?acct=" + acct;
var opReq = new XMLHttpRequest();
opReq.onreadystatechange = function() {
if (opReq.readyState === 4 && opReq.status === 200) {
callback(opReq.responseText);
}
}
opReq.open("POST", baseURL, true);
opReq.send(JSON.stringify(paramObject));
}

Once the Audit run is complete, you can go into the Variable Inventory to view the results of this script or set up a simple Tag & Variable Rule and an Alert to receive automatic notifications of pages that are out of compliance.

Did this answer your question?