Pass a custom UDO object in tealium

Anonymous
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

Pass a custom UDO object in tealium

Gold Contributor
Gold Contributor

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
Public