I am trying to create a custom JavaScript code extension in Tealium to reduce the amount of Extensions needed to differentiate CTA's for icon links that do not have alt, or title tags. I am getting the value of my b.variable in my browser console. What I am stuck on is how to set the value of a variable and have it returned to my data-layer for later usage.
if (b.nav_icon){
var classattr = b.nav_icon;
if( classattr.indexOf('icon') >= 0 & classattr.indexOf('world-new') >= 0){
var b.nav_icon = 'nav:Language Switcher';
}
}
return b.nav_icon;
How do I set and return a variable back to the data-layer?