Disneystore : Auto tracker
// Current
if (utag.data['dom.domain'].toString().indexOf('disneystore.fr') > -1) {
var eventName = false;
jQuery("#footer-fourth-life > div a").on('mousedown.tealium', function(e) {
eventName = "click:promo footer";
});
jQuery("#footer-fourth-tickets > div a").on('mousedown.tealium', function(e) {
eventName = "click:promo footer";
});
jQuery("body > div.wrapper > section.full-hp.full-width.main-asset.clip-img > div a").on('mousedown.tealium', function(e) {
eventName = "click:hero shop now button";
});
jQuery(document.body).on('mousedown.tealium', function(e) {
if (eventName) {
utag.link({
event_name: eventName
})
}
});
};
// Replace with this
if (utag.data['dom.domain'].toString().indexOf('disneystore.fr') > -1) {
var fireData = false;
jQuery("#footer-fourth-life > div a").on('mousedown.tealium', function(e) {
fireData = true;
});
jQuery("#footer-fourth-tickets > div a").on('mousedown.tealium', function(e) {
fireData = true;
});
jQuery("body > div.wrapper > section.full-hp.full-width.main-asset.clip-img > div a").on('mousedown.tealium', function(e) {
fireData = true;
});
jQuery(document.body).on('mousedown.tealium', function(e) {
if (fireData) {
event_name = (this.name) ? this.name : "unavailable";
event_link = (this.href) ? this.href : "unavailable";
utag.link({
event_type: "auto tracked",
event_name: event_name,
event_link: event_link
})
}
});
};