- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
12-18-2015 07:34 AM - edited 12-18-2015 07:47 AM
We are using a jquery onHandler extension to fire Coremetrics conversion events for elements that mactch a particular selector "[data-analyticsevent]" and using the value of the data-analyticsevent attribute to populate the ccid parameter. This has worked well while we were only being asked to fire conversion events. Now we've been asked to implement some Element Coremetrics events.
I would like to use the same jQuery onHandler and populate out Event Type UDO based on the value of another attribute on the HTML element (data-eventtype) the user has clicked on. In the onHandler extension I am accessing the value of the new HTML attribute with the following JS snippet:
$(this).data('eventtype') ? $(this).data('eventtype') : 'conversion'
In my mapped data sources for the Coremetrics tag I have mapped the value of the Event Type UDO to the following Coremetrics tags:
element:Element
conversion:Conversion
Example:
<!-- Should fire an Element event --> <a href="google.com" data-analyticsevent="GOOGLE_LINK" data-eventtype="element" /> <!-- Should fire a Conversion event --> <a href="yahoo.com" data-analyticsevent="YAHOO_LINK" />
The problem is that I am seeing both Element and Conversion Coremetrics event tags being fired when users click on either of the elements. Any ideas on why this would happen and how to fix?
Solved! Go to Solution.
12-21-2015 01:24 PM - last edited on 12-21-2015 02:08 PM by kathleen_jo
What data is getting passed in the utag.link call? You can see this by turning on the Tealium debugger and then refreshing the page. Now that the debugger is on, each time you fire off a view or link call the data gets logged in the console:
Now you can see the data sent in the link call
It is possible you will need one more Set Data Value extension to run within the Coremetircs tag to set the cm_event_type based on a condition and then only map the one cm_event_type to the Coremetrics tag instead of trying to evaluate both within the Mappings.
12-23-2015 08:49 AM
The debugger was a very useful tip. I was able to do exactly what I wanted by switching over to a custom JS solution instead of the link option in my onHandler extension.
Thanks
12-23-2015 09:28 AM
Copyright All Rights Reserved © 2008-2023