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.
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.