javascript - How to convert this string into separate string objects -


new google tag manager , not sure how this. on thankyou page, let's there is:

var purchased =  "product1;product2;product3"       

how separate each string in 'purchased' have (product), tag manager can understand there 3 unique strings:

   var product = {"product1"}, {"product2"}, {"product3"} or var product = {"product1", "product2", "product3"} 

i tried these wasn't needed:

var products = purchased.split(';'); var products = purchased.split(';').map(e => e);     // both of these return ["product1, product2, product3"] 

how splitting ;(space)? code leaves space.

var products = purchased.split(';'); 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -