Highlighted

I've been tasked with tying an event to a certain link. When this link is clicked in Chrome (link is mailto:) the tag will fire repeatedly until the window is closed. To cap it off, the event doesn't fire. This is not happening in IE/FF.

Rookie Contributor
Using js extension to assign event. object: b if (typeof u.o.events != 'undefined'){ u.o.events = ""; } if (typeof b['js_page.example.event'] != 'undefined') { var eventArray = b['js_page.example.event']; var eventLength = eventArray.length for (var i = 0; i < eventLength; i++) { var eventName = eventArray[i].eventName; if (eventName == "example event name") { u.addEvent("event1"); } }}
2 REPLIES 2
Highlighted

I've been tasked with tying an event to a certain link. When this link is clicked in Chrome (link is mailto:) the tag will fire repeatedly until the window is closed. To cap it off, the event doesn't fire. This is not happening in IE/FF.

Employee Emeritus
Holt, "When this link is clicked in Chrome (link is mailto:) the tag will fire repeatedly until the window is closed." This doesn't sound like it has to deal with the event code above. It sounds like the event listener code has some sort of loop that is triggering the tag over and over. Regarding the event, the code above is looking for an array of objects. Something like: b['js_page.example.event'] = [ {eventName:"example event name"}, {eventName:"value2"} ] The above format works with the code provided. Make sure the above format of the b['js_page.example.event'] variable matches what is getting set on your end. Also make sure the JS Code extension that is running this code is Scoped to the SiteCatalyst tag. The u.addEvent function only exists in the SC tag template. Therefore, any extension calling u.addEvent must be scoped to the tag. NOTE: As a best practice you shouldn't have to reference the "u.o" variables in extensions. Tealium will automatically set linkTrackEvents and linkTrackVars for you based on what gets mapped and triggered via u.addEvent. So the event string should always start fresh for each page load.
Highlighted

I've been tasked with tying an event to a certain link. When this link is clicked in Chrome (link is mailto:) the tag will fire repeatedly until the window is closed. To cap it off, the event doesn't fire. This is not happening in IE/FF.

Rookie Contributor
Figured it out. Turns out that there was an old version of Omniture's s_code hanging around that we didn't see. After removing that code, the loop behavior ceased. Some wonky stuff!