Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely Product Recommendations
Applies to versions: v1.2 and lower

Basket page tracking request

Recommended reading 

To track a basket page, provide a list of products in the basket along with the currency, quantity and price.

Note: In Episerver Commerce, a basket is known as a shopping cart or a cart.

The quantity and price elements should be the same as the ones the user is viewing. So if there is a discount, provide the discounted price.

Price is the price per unit. For example, if a basket has 3 units, and each unit costs £10, the value of price is 10.

NameDescriptionUsage
Basket Element containing basket specific sub-elements.  
        items List of checkout items.  
         

refCode

Product reference code.

The refCode must exactly match the refCode (guid) in the product catalog feed. If you have a custom feed, contact Episerver to find out which field from the feed is a product identifier.

    qty  Quantity. [Number]
    price Unit price. [Number]
    variant  

The product variant’s SKU code. Alternatively, the product variant’s colour and size attributes can be supplied instead.

By arrangement with Episerver, these can be replaced with another product attribute.

[Optional]

Sub-elements are of the type [String].

See the Variant tracking section.

      currency Currency code. See Currency codes.

Basket page tracking request example.

{	
	"type"		:	"basket",
	"ip"		:	"10.42.37.139",
	"session"	:	"155780550/hKugo5RQsqecUpmlWE6EpFWqmalVrJU",
	"cuid"		:	"143159800/hKugo5RQsqecUpmlWE6Eo1OklrJYp5U",
	"site"		:	"retailer",
	"clientToken"	:	"1234abcd5678",
	"channel"	:	"web",
	"lang"		:	"en-gb",
	"currentURI"	:	"www.retailer.com/basket.html",
	"previousURI"	:	"www.retailer.com/product/RC123.html",
	"userAgent"	:	"Mozilla/5.0 (Windows NT 10.0; WOW64)
          AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
	"basket"	: {
	      "items"	  : [
		      { "refCode":  "RC123", "qty":  5,  "price":  50.5 },
		      { "refCode":  "RC124", "qty":  8,  "price":  52.5 }
	      ],
	      "currency"  : "GBP"
    }
}
Do you find this information helpful? Please log in to provide feedback.

Last updated: May 23, 2018

Recommended reading