Highlighted

Mapping a UDO varibale through utag.link call which uses b.VAR

Bronze Contributor
Bronze Contributor

I am envloking a utag.link call to assign values to UDO variables. Below is the code- 

utag.link({ event_name: 'promo_impression_slim-hero',

event_entity: 'Promotion',

event_action: 'promo_impression',

event_category: 'promotions|' + <Campaign Name>, event_label: 'promotions|' + <Header name>, event_location: window.document.location.pathname, promo_click_id: 'component|' + <promo ID>, promo_click_name: 'component|' + <Campaign Name>, promo_click_creative: 'component|' +'slim_hero', promo_click_position: 'component|' + <promo position> )};

Now when using b.promo_click_id dynamically in tealium in a set data value extension, it is creating multiple promo_click_id with each letter of the strinf as a separate entity.

For e.g. : From page the value passed is - "component|testpromo-2020" then in tealium, when using b.promo_click_id to assign the same value to a particular variable, its creating multiple id with each letter like c,o,m,p,o,n.....and so on. Tried JSON.parse on b.promo_click_id as well but facing saem issue.

 

 

 

3 REPLIES 3
Highlighted

Mapping a UDO varibale through utag.link call which uses b.VAR

Tealium Employee

Hello @akshaykashyap2 

 

It sounds like your variable is being referenced as though it is an array, whereas the value being passed is actually a string.

 

Judging by the event information sent, this is for GA which would also be looking for this to be in an array instead of a string, so if you update this you should see it work as you expect.

 

If you can provide more details about the set data extension that could help, but knowing it's being treated as an array while as a string - may be enough for you to work out the rest!

 

Let me know if you need any more pointers

Mapping a UDO varibale through utag.link call which uses b.VAR

Bronze Contributor
Bronze Contributor

Hi,

You are correct. The value passed in "promo_click_name" , "promo_click_creative" are string type, when there is only one promotion rendering on web page. This is creating an issue when we map in into UDO varibales using  set data value extension and then mapping it in enhanced ecommerce Promo variables in GA tag.

I also have a query, lets assume we recieve an array in "promo_click_name" and map it in UDO using set data extension, and then use the UDO in GA Tag to map in enhanced ecommerce Promo Variable in GA Tag , which expects an array. It should work fine then ryt ??

Highlighted

Mapping a UDO varibale through utag.link call which uses b.VAR

Tealium Employee

@akshaykashyap2 

 

I don't have the tag in front of me so I can't say for certain, but I'm 99% sure that this is correct.

 

Map an array to the mappings defined in the tag UI and it should create the enhanced event for each id code in the array.

 

Map a string, and it get one event for each character in the string (obviously not what you want)

 

Update the extension to set the value to be an array, and everything should be golden!