Issue with data element
- February 22, 2017
- 3 replies
- 1103 views
I created a data element with the below custom code and have it firing on a pageload rule (bottom of page but also same results with top of page) in DTM. Everything looks good except I get a few instances of my strings I am passing but randomly truncated. (see image below). Is there a way to ensure the whole string gets passed appropriately?
var adBlockDetection = (function() {
var test = document.createElement('div');
test.innerHTML = ' '; //non-breaking space in div element
test.className = 'adsbox'; //"adsbox" is on the adblocker definition list and will get blocked
document.body.appendChild(test); // add the definition to the fake ad (div)
if (test.offsetHeight === 0) {
//console.log("AdBlocker Status: Active");
return "AdBlocker Status: Active";
} else {
//console.log("AdBlocker Status: None");
return "AdBlocker Status: None";
}
})();
return adBlockDetection;
