How to track multiple products purchased in a single visit



Hi, colleagues.

I nee to track different values inside the single variable. For example, on one of our pages user can select up to 6 devices to purchase. And for each of the device user can select number of devices. For example user can purchase two items of Device_1, three items of Device_2 and four items of Device_3. And I need to store it in variables in single hit.


So, I don't want to put all values of devices in the string with some delimiter and use this concatenated string as a single value of the eVar.

I would like to have separate value for each purchased device. Also, i need to store number of devices purchased into the second variable and be able to detect how many devices of each type were bought.

I think guys from e-commerce market do this every day )) Could somebody describe me best practices?


P.s. We use Launch with datalayer architecture.


Thanks in advance!

Accepted Solutions (0)

Answers (2)

Answers (2)




Hi Aleks,

Begin with this article explaining the s.products variable

Hi, Andrey. Thanks for the answer! Let me give more context. Product for which we need this tracking is not our main one. This is additional tools for the main IT product which we create and sell. And s.product functionality we use for this main product. That's why we don't want to mix data about the main product and additional product. What I think for now - it is to use list variable for names of the additional products. How to put number of each product to the second variable I still don't know.

Aleks, it's not clear why these products should be tracking separately... However, before considering a list variable, review the Merchandising syntax that can help you set eVars with multiple values (s.products will still be needed, but you can reserve just one value to make everything working). Look for Adam Greco articles about merchandising use cases if the documentation looks confusing.

I would DEFINITELY follow @Andrey_Osadchuk advice. Having done a LOT of work with merchandising variables and using the product string, this is probably the most powerful thing you can do to accomplish your goal. Something also very important to keep in mind is you can actually SET and INCREMENT units and dollar amount variables WITHIN your product string as separate variables.


Remember, the recommended syntax is (also, read about the category information and how you should probably NOT use it in the first position of the products string - you're better off putting it in the eVars section):

products:;<upc>;<numberOfUnits>;<orderRevenue>;events;eVars,<next item>...


Also, keep in mind you may ONLY use numberOfUnits and orderRevenue in the case where you are using the PURCHASE method.  Otherwise, if you are simply performing a cart add, view, or otherwise, then you will want to use supplemental events. What I have done is something like this:

products:;<upc>;;;eventXX=<numUnits>|eventXX=<retailPrice>|eventXX=<salePrice>;eVarXX=<description>|eVarXX=<prodCategory>,<next item>...


Happy to answer any other questions, but this should get you going. I could probably do this in my sleep now. My documentation goes back YEARS!