OP Custom Tag - Key Word Search


This ObservePoint Custom Tag allows you to search for keywords and flag pages where those keywords are found. Using the javascript snippet below in the Audit Actions configuration will fire a tag that collects your keywords, as variables with the value of true/false if that keyword is present at least once on the page.

Note: The key word search is case agnostic, so it will identify lowercase and uppercase variants of the key words. You will need to modify this Javascript by defining the key words you want to search for in the array.

//add key words to this array (separated by commas) and customize the tag account name

var words = ["Insert key Word 1", "Insert key Word 2", "Insert key Word 3"];

var tagAccountName = 'Key Word Search';




var obj = {};

var dom = document.documentElement.innerText.toLowerCase(); //don't touch this

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) {




opReq.open("POST", baseURL, true);



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

Still need help? Contact Us Contact Us