How to populate an event_type UDO for multiple Coremetrics event tags?

Bronze Contributor
Bronze Contributor

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?

3 REPLIES 3

How to populate an event_type UDO for multiple Coremetrics event tags?

Employee Emeritus

@dan_hickman

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:

 

tmp-cm1-20151221T131158.png

Now you can see the data sent in the link call

tmp-cm2-20151221T131158.png

 

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.  

How to populate an event_type UDO for multiple Coremetrics event tags?

Bronze Contributor
Bronze Contributor

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

How to populate an event_type UDO for multiple Coremetrics event tags?

Employee Emeritus

@dan_hickman

Great, glad you got it working!! 

 

Happy Holidays
Brian

Public