Pass a custom UDO object in tealium

Anonymous
Not applicable
Anonymous

Hi

 

My UDO for order confirmation page include a object for quantity as below,Can i pass the sum of the two arrays for quantity is any tag ,we are currently in codefreeze and cant make any changes to site utag_data.i need to pass quantity = 4 in mapped variables

  1. cart_product_quantity:Array(2)
    1. 0:"1"
    2. 1:"3"
1 REPLY 1
Highlighted

Pass a custom UDO object in tealium

AndreScholten
Visitor
AndreScholten

Hello @Anonymous. Create a new javascript extension, read out the array and return the sum of the quantities?

 

Something like this:

 

 

var productarray = utag_data["cart_product_quantity"];
var total = 0;

for (i = 0; i < productarray.length; i++)
{
  total += parseFloat(productarray[i]);
}
utag_data["total_cart_product_quantity"] = total;

 

Freelance Web Analist