Event tracking on click of a class

Bronze Contributor
Bronze Contributor

Hi I've used DTM, Ensighten and GTM but I'm new to Tealium and finding it slightly difficult to fire my event tracking. I've added the screenshots below in the following order to be checked by the experts where I've gone wrong and give me some suggestions - 

1. jQuert click handler to fire the event on click of a class name 'contact' and then fring tealium_event=contact

Click handler.PNG

2. Load rule when tealium_event='contact'

Load rule.PNG

3. The tag where added the load rule  tealium_event='contact'

tag.PNG

 

3 REPLIES 3

Event tracking on click of a class

Tealium Employee

Hi @abkarim

You're logic looks correct. My next suggestion would be debugging. If you are comfortable using browser debugging tools you can leverage the info in the following post:

https://community.tealiumiq.com/t5/JavaScript-utag-js/Debugging-utag-view-and-utag-link/ta-p/13695

Otherwise you should reach out to your Account Manager and have them loop in a Solutions Engineering to help resolve.

Cheers,
-Dan

Event tracking on click of a class

Gold Contributor
Gold Contributor

Hi @abkarim,

What you are doing there is firing a Google Analytics (GA) tag only when a visitor clicks on that class. By default a Google Analytics tag will throw a page view.

What I think you want to do is tracking those clicks as an event in GA. In order to do that you need to do a couple of things:

  • If you want to send an event to GA, you'd need GA to be on the page before the visitor clicks on that element. For doing this, adjust your load rules, so the tag is present in all the pages (or on the pages you want it to be).
  • GA events are defined by a category, action, label and value. Talking by memory only the first two are compulsory.
  • Therefore, you'd need to map something to those attribute. My advice is you to create a couple of data elements called event_category and event_action (on the data layer tab, or by pressing the '+' symbol next to tealium_event on your screenshot). Then you set a value (event_category to the wider description of the event contact, event_label to something more specific footer).

Avoid using tealium_event for this, as it's meant to be a default data layer key that helps distinguishing between views and links.

Hope it helps!
Pablo

Event tracking on click of a class

Community Manager
Community Manager

@abkarim As mentioned, the Google tag should use the "All Pages" load rule, then use data mappings (and sometimes extensions) to track specific events. Check out our knowledge base article on Event Tracking with Google Analytics

Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.
Public