Setting the Products String in DTM

Enough people have asked for an example of a products string that I decided to post my example page on my server.

On the example page, you can see:

  • How to build a W3C-standard data layer object for a cart with multiple items
  • How to create a simple s.products string
  • How to create more elaborate s.products strings, including merchandising eVars.
  • What the final beacon looks like.

I hope someone out there finds it helpful!

4 thoughts on “Setting the Products String in DTM

  1. Hi Jennifer,

    Thanks for the blog post about the s.products string in DTM. I noticed at the end of the products string for multiple products there is an extra comma. Does this cause any errors in adobe ? In my implementation I modified your code a little to remove the comma. Thought id share.

    var product_line=”;”+prodSku+”;”+prodQuantity+”;”+prodPrice+”;;eVar8=”+prodMethod
    if (i == 0)
    s.products = product_line;
    s.products += “,” + product_line;

    1. The extra comma shouldn’t cause any problems in reporting, but it does look sloppy.
      Thanks for the code, I’ll try to incorporate that sometime soon!

Leave a Reply

Your email address will not be published. Required fields are marked *