Cookies on Sleepless Dystopian - cyberpunk / mentalist / abstract writing
This network uses cookies. By continuing to browse this network, you agree to the use of cookies.
Close and proceed
document.addEventListener("DOMContentLoaded", function () {
if (!window.dataLayerMain) {
return;
}
var handler = function (event) {
var element = event.currentTarget;
if (element.hasAttribute('data-track-disable')) {
return;
}
var options = JSON.parse(element.getAttribute('data-track'));
window.dataLayerMain.push({
'event' : 'trackEvent',
'eventType' : 'googleAnalyticsNetwork',
'eventCategory' : options && options.category || '',
'eventAction' : options && options.action || '',
'eventLabel' : options && options.label || '',
'eventValue' : options && options.value || ''
});
if (options && options.ga4) {
window.dataLayerMain.push(options.ga4);
}
};
var elements = document.querySelectorAll('[data-track]');
for (var i = 0; i < elements.length; i++) {
elements[i].addEventListener('click', handler);
}
});