- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
I'm used to hand coding the customer onclick events in my web pages. For example, I would add code to my button like this - onClick="gtag('event', 'Click On PDF', { event_category: 'PDF', event_label: 'Song List PDF'});". That would send the event information over to Google Analytics with no problem. How do I get the same results by using Tealium? I already added the Google Analytics tag, and did the data mappings for the event category, event label and event action, but what are the other steps I do? I'm missing something small, but do I have to use extensions? Please tell me step by step what I have to do. Thanks.
07-16-2018 03:00 PM - edited 07-16-2018 03:02 PM
@michaelgray To track clicks with Tealium you can either replace your hard-coded gtag code with Tealium tracking calls or use a Javascript Code extension to add event listeners for the clicks you want to track.
In either case, your goal is to replace the vendor specific tracking calls like this one:
gtag('event', 'Click On PDF', { event_category: 'PDF', event_label: 'Song List PDF'});
With vendor-neutral Tealium tracking calls like this:
utag.link({
'tealium_event' : 'custom_click',
'event_action' : 'Click On PDF',
'event_category' : 'PDF',
'event_label' : 'Song List PDF'
});
From there you will map the Tealium variables to the corresonding vendor variables (it sounds like you're already doing this). This makes it easy to configure any additional vendor tags to make use of the same tracking call. Hope that helps.
More info: Event tracking (with utag.js)
Copyright All Rights Reserved © 2008-2023