Tracking Page Views
While CustomerLabs tracks standard page views by default, you can use the Javascript API to track specific page view types like Category Viewed, Product Viewed, or Pricing Page Viewed.
Configuring the custom Page View Events
Section titled “Configuring the custom Page View Events”Examples for Custom Page View:
Category viewedProduct viewedCart viewedThank you page viewed- Any custom event names can be used here.
Syntax
Section titled “Syntax”_cl.pageview(eventName, properties)Example: Category Viewed
Section titled “Example: Category Viewed”Use this snippet to track when a user visits a specific category page.
var eventName = "Category viewed";
var properties = { "customProperties": { "page_url": { "t": "string", "v": window.location.href }, "category_name": { "t": "string", "v": "Example Category" } }};
_cl.pageview(eventName, properties);Parameters
Section titled “Parameters”There are no mandatory parameters for page view event to be included in the customProperties object. However, you can include any valid string or number as a parameter to the customProperties object such as page_url, page_title, category_name, etc. based on the event and context.