Track custom events in Google Analytics through Tealium?

Silver Contributor
Silver Contributor

Can anyone help me to get, how to track "Custom events" in Google Universal Analytics through Tealium implementation, please guide me step by step process to implement?

 

Ex: I have one website which contains Two Tabs - each tab have 15 anchor links. I want to track each link that how many times end users clicked the links.

I want to track these links in "Custom events" on Google Analytics. 

 

 

Help me on this.

 

Thanks!

 

 

Knowledge Learning & Sharing
4 REPLIES 4

Track custom events in Google Analytics through Tealium?

Tealium Employee

Hello @srinii86. The easiest way to do this is using a jQuery onHandler extension (if you have jQuery 1.7 upwards) 

 

https://community.tealiumiq.com/t5/User-Documentation/jQuery-onHandler-Extension-jQuery-v1-7-and-up/...

 

or a jQuery onClick extension if you have 1.6 or below, which behaves in much the same way. 

Connecting data systems since the 1980s.

Track custom events in Google Analytics through Tealium?

Bronze Contributor
Bronze Contributor

We've done some similar stuff using the utag.link call.

 

utag.link({ga_event_action:"some_action", ga_event_category:"some_category", ga_event_label:"some_label"});

 

There are a couple ways you can implement this. 

 

1. As mentioned by the previous commenter,  attach the utag.link call to a click event using jquery. If implementing through Tealium, you can do this by: creating a custom container, make sure it loads on the page, then cut and paste your jquery to attached the click events.

 

This might look like: 

$('#your_selector').click(function() {
utag.link({ga_event_action:"some_action", ga_event_category:"some_category", ga_event_label:"some_label"});
});

 

2. For a more permanent solution you can consider attaching the click behavior to the onClick property of your anchor tags. 

 

This might look like:

<a href="#" onClick="(utag.link({ga_event_action:'some_action', ga_event_category:'some_category', ga_event_label:'some_label'});">Your Link</a>

Hope this helps!

Track custom events in Google Analytics through Tealium?

Bronze Contributor
Bronze Contributor

One thing I also forgot to add is for the values inside the utag.link call, you'll need to  define them as js variables in the datalayer and then also map those values to your GA tag so that Tealium knows what to do with the values.

 

For example:

The variable ga_event_action in our setup has the destination ga_eventaction in our Google Analytics tag.

Track custom events in Google Analytics through Tealium?

Silver Contributor
Silver Contributor

@josh_grupp and @steve_lake

 

Thanks for your prompt response with your valuable inputs.

 

if possible, could you please share any screenshot with the implementation process to track custom events in Google Universal Analytics through Tealium tool.

 

In Google Analytics & Tealium implmementation screenshots?

 

As, i'm new to Tealium configuration on implementing GUA. Previously i have worked on SC.

 

Thanks!

Knowledge Learning & Sharing
Public