Tracking Pages

The Contextual Commerce Brain uses all sorts of different sources of information to make its decisions. One of those is the shoppers' browsing activity. We monitor which pages are visited, which products, which type of pages, how long the shopper spends on each page / type of page, and so on.

Contextual Commerce recognizes these different types of pages:

  • home - The home page of the app
  • product - A page representing a single product, which might have - multiple variations. One productId, multiple SKUs
  • collection - A page containing multiple products or child categories for - selection.
  • ensemble - A page listing a small group of products similar to a collection, but allows for the products to be added to the cart. The products are often related in some way such as a full outfit.
  • search - A page allowing search (if that is a dedicated page) and the page which displays the results of a search
  • blog - Topical, informational articles not specifically related to purchasing products
  • cart - Page listing the contents of the cart, allow the shopper to manage their cart, and continue to complete their purchase
  • checkout - The page allowing the shopper to complete their purchase
  • flights - Special form of the product page used specifically for flight booking sites
  • account - Admin pages allowing the shopper to view past purchases and manage their account
  • login - Page allowing the user to log in (or log out)
  • info - Permanent informational pages about the site (eg: About Us)
  • guide - Page to help or guide shoppers through the purchase journey
  • video - Page dedicated to video content
  • other - Any page to which a specific page type does not apply
  • receipt - Page shown after a completed checkout
  • wishlist - Page showing a current wishlist, or list of wishlists

Certain types of pages require a unique identifier to be passed into TrackPageView via the path property of the pageIdentifier parameter. This unique identifier is used by the Contextual Commerce system to distinguish between instances of a specific type of page.

This unique identifier must be used for any page type that can have multiple different versions, including but not limited to product, collection, or blog.

Examples of unique identifiers:

  • Product: Product Id
  • Category: Full category path (eg: top level/mid level/child level)
  • Blog: Article title (possibly with date)

Some of our campaigns contain buttons that will navigate to other pages in your application. To do that we require a Navigator object to be passed into activate and the TrackPageView component. Although these are optional parameters, on iOS, it is required to be passed into activate for campaign navigation buttons to work correctly. On Android, it is required to be passed into TrackPageView for campaign navigation buttons to work correctly.

The object contains callbacks used to navigate to the following pages:

  1. Cart
  2. A product page based on a product id and/or sku.

An example Navigator is shown below.

const navigator: Navigator = {
cartNavigationCallback: () => {
Linking.openURL("app://cart");
},
productNavigationCallback: (productId: string, sku?: string) => {
Linking.openURL("app://" + product + "/" + sku);
}