How to track the click button through Launch data element and pass attribute value to Adobe Analytics?

Avatar

Avatar

in_kook65578246

Avatar

in_kook65578246

in_kook65578246

07-11-2018

Hi,

I have created several same buttons on a page (same cssClass, different attribute). I create an event rule using the css selector. What I want to do is track which one the customer click and then set its value as an eVar or Props.  I know I can create event rule for each of them but it is stupid.

I find an answer for dtm and try to imitate it. However in Launch, the keyword "this" point to a null object in Launch.

Any solution to this problem?

Thanks!

How to track the click url through data element and pass to Adobe Analytics?

1616588_pastedImage_0.png

1616589_pastedImage_1.png

1616590_pastedImage_2.png

View Entire Topic

Avatar

Avatar

thomas_amsler

Avatar

thomas_amsler

thomas_amsler

24-07-2019

I can try to outline how I would do it with a custom script, though I have to say, custom attributes are not recommended, you should either use the "data-" prefix or introduce a separate namespace with a linked DTD.

So I assume you have a rule that get's triggered when this button is clicked.

In the "Set Variables" action within the custom code you can access this button "event.target". From this you can access the attribute by name "event.target.getAttribute('cst-text')" and apply it to an eVar or prop.

I am not sure if you could create a data element with script code that can access the element that triggered the rule.