Tracking product views
Sending product views to Engage is a prerequisite to:
Trigger browse abandonment
Build audiences based on products of interest
Get improved product recommendations
The method used to register a product view is productview().
The productview() method
Invoke this method every time a product is viewed, whether the user has been identified by the website or not. This method will then generate a HTTP POST request to the Collect endpoint.
Param | Type | Description |
---|---|---|
*categoryName | string | Product category, e.g. “Men / Sweaters / Cardigan” |
*itemId | string | Mapped to SKU in Engage |
contactId | string | The Engage contact ID |
**locale | string | Format as defined by IETF language tag. Should match a product feed locale in Engage and is required for abandoned browse automations. |
Fields marked * are mandatory and ** is mandatory when using abandoned browse.
This is what a call to the productview() method looks like:
va("productview", { "categoryName": "Women / Armour / Greaves", "itemId": "123XYZ", "contactId":"afa7625d-2e97-4667-b4c1-ad3b01194bbb", "locale":"sv-SE" })
Use cases
When the user enters the e-com by a link from newsletter
They clicks a link to the e-com in a newsletter from Engage.
The link is decorated with vtid (contact ID).
The user views a specific product and invokes productview()
Populate categoryName with the current product category (e.g. “categoryName”: ”Computer accessories > Printers > Toners”)
Populate itemId with the current product SKU (e.g. "itemId": "549852″)
Populate locale based on the current language/market of the site (e.g. “locale“: “sv-SE“)
Populate contactId with the users contact id from Engage, vtid is used as fallback
When the user enters the e-com unidentified
The user browses into the e-com and is not identified
The user views a specific product, invoking productview()
Populate categoryName with the current product category (e.g. “categoryName”: ”Computer accessories > Printers > Toners”)
Populate itemId with the current product SKU (e.g. "itemId":"549852″)
Populate locale based on the current language/market of the site (e.g. “locale“: “sv-SE“)
Do not populate contactId
The tracking API
It's possible to register product views via the tracking API instead of implementing the tracking script. If you do this, it's important to identify the contacts who enter the e-com from a link in a newsletter by reading the query string parameter vtid which holds the contact ID. Only identified productviews can be registered via API (the contactId is required).
Read more about the Engage REST API here.
Important points when tracking product views
Call productview() or the productview API in all cases, regardless of whether the user is anonymous/identified or logged in. All behavioral data can be used to create insights. A product view belonging to an anonymous user can be linked to a specific user after the user is identified.
Call productview() for all product views using an itemId that matches SKU in Engage. A product view can be a visit to a product page but can also be anything else that shows a selected product to the user, for example a “quick look” in a popup. The product/itemId will be matched against the SKU in Engage and enriched with product and transaction data. A product page can call productview() multiple times if it represents multiple SKUs.