- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
02-28-2018 05:56 AM
Hello.
I'm trying to set up an extension that fires an event when a button is clicked.
I used the WebCompanion Tool and created a jQuery clickHandler Extension after using the On-Page Selector on the button.
What's the best way to check now if the Event is firing? In my EventStream I don't get any events when I click the button. So I'm not sure if my Extension is working at all.
Furthermore I'm not sure about the "To:" mapping of the variable. I want to use the value of a text input form:
I'm thankful for any kind of help.
Solved! Go to Solution.
02-28-2018 12:06 PM
The easiest way to debug the onHandler extension is to start off with a "Custom" tracking event, which allows you to then enter your own code rather than using utag.link()/.view().
Now, in terms of the JS code for e-mail address, I suspect it ought to be:
jQuery("#email_element_id").val()
So when you come to enter custom tracking code, enter something like:
console.log( "Event debug", jQuery("#email_element_id").val() );
In which case, if the handler is correctly being triggered on the mousedown event, you should see a console log of the value that would be passed into the Tealium event. Once you've played around and gotten that to your liking, switch back to firing a link() event and pass the e-mail address into your target UDO parameter.
02-28-2018 01:24 PM
@thedonesteban something else to consider is turning on utag debug. It'll show you all link
and view
calls along with the data object sent. Instructions on how to turn it on are available here: Console Debug Output.
If you're interested, I use a bookmarklet to toggle it all the time.
javascript:(function()%7Bwindow.utag_toggle_debug %3D %7B%7D%3Butag_toggle_debug.get_future_date %3D function()%7Ba %3D new Date()%3Bb %3D new Date()%3Bb.setTime(a.getTime() %2B (365 * 24 * 60 * 60 * 1000))%3Bc %3D b.toGMTString()%3Breturn c%3B%7D%3Butag_toggle_debug.date_in_future %3D utag_toggle_debug.get_future_date()%3Butag_toggle_debug.date_in_past %3D %27Thu, 01-Jan-70 00:00:01 GMT%27%3Butag_toggle_debug.debug %3D %27utagdb%3Dtrue%27%3Butag_toggle_debug.undebug %3D %27utagdb%3Dfalse%27%3Bif(document.cookie.indexOf(%27utagdb%3Dtrue%27) !%3D%3D -1)%7Bconsole.log(%27debugger on, turning off.%27)%3Bif(typeof utag !%3D%3D %27undefined%27 %26%26 typeof utag.cfg !%3D%3D %27undefined%27)%7Butag.cfg.utagdb%3Dfalse%3B%7Ddocument.cookie %3D utag_toggle_debug.undebug %2B %27%3Bpath%3D/%3Bexpires%3D%27 %2B utag_toggle_debug.date_in_past%3Bif(document.cookie.indexOf(%27utagdb%3Dtrue%27) !%3D%3D -1)%7Bconsole.log(%27debugger still on, turning again to turn off.%27)%3Bdocument.cookie %3D utag_toggle_debug.undebug%3B%7D%7Delse%7Bdocument.cookie %3D utag_toggle_debug.debug %2B %27%3Bpath%3D/%3Bexpires%3D%27 %2B utag_toggle_debug.date_in_future%3Bif(typeof utag !%3D%3D %27undefined%27 %26%26 typeof utag.cfg !%3D%3D %27undefined%27)%7Butag.cfg.utagdb%3Dtrue%3B%7Dconsole.log(%27debugger off, turning on.%27)%3Bif(document.cookie.indexOf(%27utagdb%3Dtrue%27) %3D%3D%3D -1)%7Bconsole.log(%27debugger still off, turning again to turn on.%27)%3Bdocument.cookie %3D utag_toggle_debug.debug%3B%7D%7D%7D)()
Copyright All Rights Reserved © 2008-2023