Area: Optimizely Product Recommendations
Applies to versions: 1.0 and higher (JavaScript API)

Basket page tracking request

Recommended reading 

The basket page is tracked by providing a list of products in the basket along with the quantity, currency, and unit price.

Quantity and unit price should match what the site visitor sees. So if there is a discount, the discounted price is provided.

Name Description and usage
basket Element containing basket specific sub-elements.
  items List of checkout items.


Product reference code.
  qty [Number]

    price [Number]

Unit price.
  currency Currency code.

See Currency codes.
  basketId [Optional]

Link a specific shopping basket in a Trigger campaign. See Link to a specific basket.

A basket page is tracked using the following script.

  "type"   : "basket",
  "lang"   : "en-gb",
  "basket" : {
	       "items"    : [{
			       "refCode" : "PROD500",
			       "qty"     : 2,
			       "price"   : 25.5
			       "refCode" : "PROD600",
			       "qty"     : 4,
			       "price"   : 12.0
	       "currency" : "GBP"

This example illustrates a basket with 6 items.

  • 2 units of PROD500 @ £25.50 each.
  • 4 units PROD600 @ £12.00 each.

Related topic

Do you find this information helpful? Please log in to provide feedback.

Last updated: Nov 06, 2017

Recommended reading