Skip to main content
All CollectionsObservePoint Custom Tag
OP Custom Tag - Checking the Privacy Policy Link
OP Custom Tag - Checking the Privacy Policy Link
Luiza Gircoveanu avatar
Written by Luiza Gircoveanu
Updated over 5 months ago

Overview

An important aspect of many Data Privacy laws is the requirement for the privacy policy to be easily accessible from any page on the website. You can check your site for any pages missing the privacy policy link.

Note: Please use the verbiage that best applies to your website, we have put Privacy Policy 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 the privacy policy link on each page of the Audit:

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

  2. Create an On-page action with an execute action type and paste in the following code:

//add a CSS Selector to match your privacy policy link e.g. [href*='privacy-policy']

var cssSelector = 'INSERT CSS SELECTOR HERE';
var tagAccountName = 'Privacy Policy Check';

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

var obj = {};
obj['privacyPolicyPresent'] = [...document.querySelectorAll(cssSelector)].length > 0 ? true : 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));
}
  1. Modify the code "INSERT CSS SELECTOR HERE" line with your own CSS selector to identify the privacy link on your site.

  2. Set the action to run on every page.

  3. Save and run the Audit.

Once an Audit run is complete, you can go into the Variable Inventory to view the results of this script.

Did this answer your question?