This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Macro: "data-track-gtm - get from element" | |
// Returns: Boolean - does this element, or one of its parents, have a data-track-gtm attribute? | |
function() { | |
var isSet = function(val) { | |
return val !== null && val !== ''; | |
}; | |
var el = {{element}}; | |
var val = el.getAttribute('data-track-gtm'); | |
while (el && el !== document.body && !isSet(val)) { |