We recently migrated to Adobe Launch from DTM and we noticed that our links are now sending undefined values. When we did an investigation we noticed that when users click our buttons on the console we get back the following message.
"this.getAttribute" is not a function.
I have searched the Adobe Launch best practices documents and there are no new updates around this. Please can you assist if you have experienced the same issue and managed to resolve it?
The Data Element "cust_linkName" is set up as a custom code as follows. It looks odd because:
1) the comment line is referring to the link while this DE is not fired on a link click. In other words, if this code was fired on link click, then it would work as expected, but since it's a regular data element the "this" variable is referring to the window object.
2) the usage of setVar will not work as it writes a custom variable with the name of the existing data element
I assume, that this custom code was supposed to be fired inside a Rule mapped to the Mouse Click event. The code will work either in Conditions or Actions, and if you want to use the cust_linkName custom variable, delete this data element first.
//*-* Set a custom DE to hold the link name globally
var data_id = this.getAttribute('data-id');
var data_text = this.getAttribute('data-text');
var data_intent = this.getAttribute('data-intent');
var data_component = this.getAttribute('data-scope');
//*-* Set virtual Data element
_satellite.setVar('cust_linkName', data_intent + " | " + data_component + " | " + data_text);