Skip to content
Lance Vo edited this page Apr 14, 2016 · 2 revisions

Create custom data element

I.e: User clicks on a link, and you need to retrieve a value which positioned outside of the link.

In the Rule Conditions, add a custom criteria. In the Custom text box, insert necessary javascript to retrieve the needed value. Important: this is the clicked element, so you can traverse element with jQuery

// get title outside of the clicked element
var title = $(this).closest('.wrapper').find('.otherElement').text();

// create a custom element 
_satellite.setVar('MyCustomTitle', title);

// make sure to return true - to execute the code
return true;

MyCustomTitle is now ready to be used in eVars on Adobe Analytics tab. Select an Evar name, in Set as, use %MyCustomTitle% to get the value.

Clone this wiki locally