Custom Tag Template

Overview

The OP Custom tag pulls data into ObservePoint Audits and Journeys, making it accessible to validate with rules.

Use Cases

The tags themselves are completely custom and can be used for a variety of use cases including:

  • Scraping HTML for key words (e.g. rebranding, checking for consent manager links, searching for videos or images, finding JS files, SEO data, etc.)
  • Looking at custom objects in the console (e.g. data layer objects, event listeners, etc.)
  • Other browser attributes (e.g. 1st party cookies, browser width, user agents, etc.)

Template

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));
}
////////////////////////////////////////////////// Above is script that fires the OP Custom Tag, you should NOT modify it /////////////////////////////////////////////////////

//The Script below is what you build and send to ObservePoint
var obj = {};

obj['Variable Name goes here'] = 'value goes here'; //Here you fill the object with key-value pairs

//this tells your tag to fire and gives it the account name of your choice.
opReqGetAsync(obj, 'ACCOUNT NAME GOES HERE');

Out of the Box

We have created a lot of custom tags and want you to leverage them for your objectives. Here is a guide with all of the ones we have already built.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.