Hi, I am trying to track the links as shown in the screenshot (pink) and to give it the eventlabel of the corresponding Header Title (orange). How do I go about that? Thanks for any help! I have the following extensions ready: DOM Ready JS Code: // jQuery listener for all 'a' Tags at the Page
jQuery(document).on('click', 'a', function(e) {
// Variable Declaration
var tgt = jQuery(e.target);
var clickURL = tgt.attr('href');
var clickText = tgt.text().replace(/[^a-zA-Z0-9]+/g, "-");
var clickClass = tgt.attr('class');
var clickID = tgt.attr('id');
var clickURLHostname = this.hostname;
var clickURLPath = this.pathname;
var clickElement = jQuery(e.target)[0];
var clickType;
// Check if the clicked Link is internal or External.
// Please edit 'PLACEHOLDER'
if (clickURLHostname.indexOf("zweipunkt.com") === -1) {
clickType = "external";
}else {
clickType = "internal";
}
// sent Tealium Event with all click Elements
utag.link({
'tealium_event' : 'link_click',
'click_url' : clickURL,
'click_text' : clickText,
'click_class' : clickClass,
'click_id' : clickID,
'click_urlHostname' : clickURLHostname,
'click_urlPath' : clickURLPath,
'click_type' : clickType,
'click_element': clickElement
});
});
Thanks for any help!
... View more