Our website has eight links to social media. Currently, I have a separate event rule for each of these. Values are manually assigned: prop23="Facebook"
This is kind of stupid!
I want to create an event rule that will populate prop23 with part of the alt tag
alt="Facebook Logo" would become prop23="Facebook"
I have added this code as a Custom Rule Condition:
var linkName = this.getAttribute('alt');
_satellite.notify("Result: "+linkName,1);
var social= linkName.substring(0,8);
_satellite.notify("Result2: "+social,1);
return true;
It returns:
"SATELLITE: Result: Facebook Logo"
"SATELLITE: Result2: Facebook"
How can I populate prop23 with the value from my variable named "social"?
Is there a way to set the value of a Data Element in this code?
Thanks,
Ali