setEcommerceView

❗️

Deprecated

This method is no longer recommended.

The setEcommerceView() method is a helper method for tracking product views and category views. It has to always be followed by trackPageView().

Syntax

setEcommerceView(\[productSKU\[, productName\[, productCategory[, productPrice]]]])
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void

Parameters

productSKU (string, optional)

The stock-keeping unit of the added product.

productName (string, optional)

The name of the added product.

productCategory (string | array, optional)

The category of the added product. It can be an array of up to 5 categories.

productPrice (number, optional)

The price of the added product.

Examples

To track a product view:

paq.push([  
  "setEcommerceView",  
  "584340",  
  "Specialized Stumpjumper",  
  "Mountain bike",  
  5000,  
  1,  
]);  
_paq.push(["trackPageView"]);
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void
setEcommerceView(productSKU, productName?, productCategory?, productPrice?): void

Notes

  • This method doesn't send any data to Piwik PRO. It has to always be followed by the trackPageView() method.

Related methods