- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
03-20-2018 03:10 AM
03-20-2018 07:37 AM
@TracyAu are you looking for another method, besides view
and link
, or are you trying to send a call without using JavaScript?
03-20-2018 03:47 PM
@TracyAu are you trying to achive this for any Webanalytics calls?
Thanks!
03-20-2018 08:02 PM
03-20-2018 08:06 PM
03-21-2018 03:17 AM
@TracyAu I would be interested to understand what your use case here is.
utag's event tracking is built on the view and link methods for tracking pageview and user interaction events which all tags are built to support. You are able to trigger your own events by using the utag.track() method and passing in your own event name. So for example:
utag.track('video',{});
You would need to modify your tag templates to support such an event as by default they only support view and link events.
03-21-2018 07:39 PM
@simon_browning, do you mean to modify tag templates and update the script: u.ev={view:1}; for other tracking ?
03-22-2018 04:36 AM
@TracyAu yes that is what I was referring to.
03-23-2018 12:58 AM
@simon_browning, thanks a lot for your reply.
Seems jQuery handler extension somehow can help me for some event tracking issue, in addition for jQuery handler extension, I wonder if custom javescript code can also help for event tracking either...is it feasible to do so?
03-23-2018 01:55 AM
Ah, I think we might have looked at solving the same issue.
In our case, we wanted to:
There are two approaches you can take. The first is to create wrapper functions for utag.view() and utag.link(). If handling utag.js unavailability is your primary goal, then try the following:
// Add this code to all your pages window.utag_view = function(){ // do nothing }; window.utag_link = function(){ // do nothing }; // Add this code to a DOM Ready Tealium extension window.utag_view = window.utag.view; window.utag_link = window.utag.link;
That'll basically give you a set of utag_view and utag_link functions which will be inert if utag.js hasn't loaded, but once utag.js has loaded, they'll be repointed to be references to the built-in utag.view and utag.link functions. Then any time you want to trigger a link event, use utag_link - if Tealium is there, it'll be routed via the utag function, otherwise it will fail gracefully. If you were to later change your tag management vendor, you could just repurpose those two functions and point them at the alternative vendor.
The other approach is to build all of your tracking within Tealium itself, so never fire events from the page, but rather create event listeners. In our case, we used custom attributes against on-page elements, for example:
<input id="0.1.1.1.2" name="txtTitle" data-analytics-narrative="Customer Title" data-analytics-tracking="full" data-analytics-persist="customer_title" />
Those attributes describe the field in question in a reporting-friendly way, the expected behaviour for an event (do we capture an interaction, capture the value of the interaction, or capture nothing?) and the UDO variable into which we might persist the value thereafter (if needed).
Then we used jQuery to track blur events against input elements, registering the event handlers in a Tealium extension, and used the custom attributes against the element in question to populate the event payload before pushing it into utag.link, all within Tealium extensions.
Hope that's of some use..
03-23-2018 04:11 AM
04-02-2018 08:49 PM
04-03-2018 02:40 PM
OOOooooooo @TracyAu. I'd accept some of the replies as solutions. #hinthint #winkwink
#hugs
01-30-2019 10:11 AM
Just to close the loop on this thread. The best way to implement event tracking without coding your site with calls to utag.view()
and utag.link()
is to implement a combination of HTML5 data attributes in your page code and the jQuery Extension in iQ.
More info here: Event Tracking - Understanding Your Options
Copyright All Rights Reserved © 2008-2023