Category Page Event API – Prefixbox Documentation

First you have to inject our integration script into your website.
The script is the following:

<!-- Prefixbox Integration -->
<script> window.prefixboxAnalytics=window.prefixboxAnalytics||function(t,s,p){(window.pfbxQueue=window.pfbxQueue||[]).push({type:t,source:s,params:p});}; </script> <script async id="prefixbox-integration" website="websiteTracker" application="appTracker" src="https://cdn.prefixbox.com/plugin/integration.js"> </script>
<!-- End Prefixbox Integration -->

or alternatively:

<!-- Prefixbox Integration -->
<script> window.prefixboxAnalytics=window.prefixboxAnalytics||function(t,s,p){(window.pfbxQueue=window.pfbxQueue||[]).push({type:t,source:s,params:p});}; var ps=document.createElement("script"); ps.type="text/javascript"; ps.id="prefixbox-integration"; ps.setAttribute("website", "websiteTracker"); ps.setAttribute("application", "appTracker"); ps.async=1; ps.src="https://cdn.prefixbox.com/plugin/integration.js"; document.getElementsByTagName("head")[0].appendChild(ps); </script>
<!-- End Prefixbox Integration -->

Parameters:

  • websiteTracker – The tracker of the website. This attribute is mandatory.
  • appTracker – The tracker of the application. Define this attribute if you want to use an exact version of your application, otherwise the active version will be loaded.

Category Page Event API

View

This event must be raised when Category page is viewed by the user.

Syntax:

prefixboxAnalytics(‘result’, ‘category’, inputParams)

Required parameters of the inputParams object:

  • id – Unique identifier of the category.
  • name – The name of the category.
  • url – The URL of the current category page.
  • count – Number of products on this category page.

Optional fields of the inputParams object:

  • pattern – The search query executed by the user.

Example:

window.prefixboxAnalytics('result', 'category', { id: 'category-15', url: 'https://mywebsite.com/categories/category-15', count: 30, name: 'Mobile phones', pattern: 'samsung' });

Click

This event must be raised when a product is being clicked on the category page.

Syntax:

prefixboxAnalytics(‘click’, ‘category’, inputParams)

Required parameters of the inputParams object:

  • id – Unique identifier of the category.
  • name – The name of the category.
  • url – The URL of the current category page.
  • productId – Unique identifier of the product.
  • productTitle – Name of the product.
  • productUrl – Url of the product.
  • position – Position of the product.

Optional fields of the inputParams object:

  • pattern – The search query executed by the user.

Example:

window.prefixboxAnalytics('click', 'category', { id: 'category-15', pattern: 'samsung', url: 'https://mywebsite.com/categories/category-15', name: 'Mobile phones', position: 3, productId: 'hk483-5', productTitle: 'Samsung Galaxy', productUrl: 'https://mywebsite.com/products/hk483-5' });

Cart

This event must be raised when a product is being added to the shopping cart on the category page.

Syntax:

prefixboxAnalytics(‘cart’, ‘category’, inputParams)

Required parameters of the inputParams object:

  • id – Unique identifier of the category.
  • name – The name of the category.
  • url – The URL of the current category page.
  • productId – Unique identifier of the product.
  • productTitle – Name of the product.
  • productUrl – Url of the product.
  • position – Position of the product.
  • price – Price of the product.
  • itemCount – Number of products added to the cart.

Optional fields of the inputParams object:

  • pattern – The search query executed by the user.
  • currency – the currency of the price of the product, service, software, etc. in the ISO 4217 3 letter format.

Example:

window.prefixboxAnalytics('cart', 'category', { id: 'category-15', pattern: 'samsung', url: 'https://mywebsite.com/categories/category-15', name: 'Mobile phones', position: 3, productId: 'hk483-5', productTitle: 'Samsung Galaxy', productUrl: 'https://mywebsite.com/products/hk483-5', price: 87000, itemCount: 1, currency: 'HUF' });