e-Commerce - How to integrate Jixie tracker on eCommerce

This article explains how to integrate Jixie tracker on the different web pages of an Ecommerce website. It applies to both desktop and mobile.

For applications, there are other options described in other articles:

  • using Appflyer

  • using Branch

  • using Adjust

  • using directly our API

Introduction

Jixie tracker is some Javascript to integrate to pages. There are 2 parts:

  1. A script sitting on Jixie servers, served using our regional CDN to allow caching at the closest to the user,

  2. Some parameters to call the script to be set by the merchant.

In terms of performance, the call is asynchronous to minimize any impact on the user experience. If the script is called several times in a row (for example due to a wrong integration as it is not supposed to happen), we block the requests to 1 request maximum per page every second to preserve the user experience.

The script is compatible with GTM.

The merchant partner has full control on the data sent to Jixie. We don’t retrieve any other data, except usual technical data from the IP header of the request (IP address, UA, language of the browser, …).

Jixie doesn’t collect any PII data. The email, when provided, has to be SHA256 hashed. It is used for multi-device/multi-browser tracking. From the hashed version, it is not possible to get the actual email of the user (can be seen as an unique ID of the user, and can be replaced by any ID the merchant is comfortable with). If the email is not provided, then we won’t be able to do multi device/browsers tracking.

Example of script integration:

<script type="text/javascript">
    window.jixie_o = {
        accountid: "123456",
        sha256mail: "ab54c9890w3hg543wert"
    };
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
 	    action: "purchase",
 	    parameters: {
	        items:[{itemid:"54fg4", price:"23.21", currency:"USD",quantity:2}],
	        transactionid: "434jh323"
 	    }
 	});	
</script>
<script src="{script URL}"></script>

The {script URL} will be provided to you by your Jixie' representative.

Options Parameters set in the option object jixie_o

Parameter

Description

accountid (mandatory)

The ID that has been provided by your account manager

sha256mail (optional)

SHA256 encoded email following the normalization as explained on https://unifiedid.com/docs/getting-started/gs-normalization-encoding#email-address-normalization

sha256phone (optional)

SHA256 encoded phone number following the normalization as explained on https://unifiedid.com/docs/getting-started/gs-normalization-encoding#phone-number-normalization

partner_id (optional)

A partner ID (override partner_cookie if provided). You can provide us any partner ID that uniquely identify your users.

partner_cookie (optional)

The cookie from which we retrieve the partner_id. If the partner ID is stored in a cookie you create, we can retrieve it directly.

sha256mail_cookie (optional)

The cookie storing the hashed email.

deviceid (optional)

The device ID of the user when known.

The tracker is using a parameter to identify your website: it is the accountid.

When the user is logged you can send his encrypted email address: for example, instead of me@myemail.com we will ask for its SHA 256 encoding. This hashed email is used for multi-device tracking.

If the user is not registered, either don’t integrate the parameter, either let it empty.

Never provide a non hashed email address.

We can also handle partner IDs that will be used to sync ID or to report based on those IDs instead of Jixie IDs. It is given either by filling the partner_id parameter, either by setting the name of the cookie to retrieve the ID from.

Shared parameter across pages: action

All pages include the parameter action. It simply describes on which page the user is, or which action he is performing. Additional parameters need to be provided depending on the action. The different potential actions are:

  • viewhome: used when the user visits a home page

  • viewitem: used when the user visits an article (or item, or product)

  • viewlist: used when the user browse a list of items. For example the list of monitor products.

  • viewsearch: used when the user make a search on the website

  • viewcart: used when the user is on the basket page

  • addcart: used when the user ads an item to his basket

  • addwishlist: used when the user adds an item in its favorites or wish list

  • purchase: used when the user make a purchase

  • install: used when the user installs an application

  • subscription: used when a user subscribes to an offer

  • viewsection: used when the user visits a section (for publishers, it is sub home page, for example the news section of a website, for a e-commerce it can be a category page).

  • visit: used when the user visits any other page (for publishers, it will be an article for example).

  • startfunnel: used when the user starts a funnel (for example payment or subscription or lead acquisition)

  • funnelcompleted: used when a user completed a funnel (for example payment or subscription or lead acquisition)

Product parameters

For several actions we need to receive the description of related items. The structure of the items is always the same. What changes is that the parameters can integrate a single item or several items depending on the case.

An item is defined with mandatory attributes, and optional ones. They are provided as JSON objects.

Attribute

Type

Description

itemid (mandatory)

string

The ID of the product/offer that can be found in the products/offers feed shared with Jixie.

price (mandatory)

float

The price is the item is local currency.

currency (mandatory)

string

ISO 4217 code of the currency (for example IDR, USD, SGD, …)

quantity (optional)

integer

The number of products (default 1)

product_name (optional)

string

The product name.

category (optional)

string

The category of the product. Can be literal or code of the category.

availability (optional)

string

Value can be instock, preorder, reorder.

recurrence (optional)

string

For subscription, indicates the recurrence of the subscription. Acceptable values are daily, weekly, monthly, yearly.

Note that 2 actions request only the ID of the product, but not its full description: search and list. Indeed, they can integrate numerous products, then it is to avoid having a too large request and potentially slowing down the experience for the end user.

Example of object:

{
    "itemid":"123456",
    "price":23.21,
    "currency":"USD",
    "quantity":1,
    "product_name":"Our awesome product",
    "category":"Electronics",
    "availability":"instock"
}

Which tracker for which type of page

Homepage

For the homepage, only provide the parameters action with value viewhome.

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
 	    action: "viewhome"
 	});	
</script>

Item page

For the item page, the parameter action is viewitem.

Provide the details of the item in the property parameters (an item object).

Example:

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "viewitem",
	    parameters:{
 		    itemid:"54fg4",
 		    price:"23.21", 
 		    currency:"USD",
 		    availability: "instock"
 	    }
 	});	
</script>

Listing page

For the listing page, the parameter action is viewlist.

Provide the details of the list:

  • items: a JSON array of the IDs of the products. IDs have to be the same ids as the ones provided with your catalogue of products

  • category: if it is a category list, the category. If it is a channel page, the name of the channel.

  • page: in case of multipage, the page number (for infinite scrolling, should be the number of calls to extend the list of items)

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "viewlist",
	    parameters:{
 		    items:["54fg4","98ud-tr7-234"],
		    category:"1475", 
		    page:1
 	    }
 	});	
</script>

Search page

For the search page, the parameter action is viewsearch.

Provide the details of the search:

  • items: a JSON array of the IDs of the product. IDs have to be the same ids as the ones provided with your catalogue of products

  • keywords: a JSON array with the keywords used for the search

  • page: in case of multipage, the page number (for infinite scrolling, should be the number of calls to extend the list of items)

Example:

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
		action: "viewsearch",
		parameters:{
 		    items:["54fg4","98ud-tr7-234"],
 		    keywords:["samsung","s10"],
 		    page:1
 		}
 	});	
</script>

Cart page

For the view cart page, the parameter action is viewcart.

Provide the details of the cart:

  • items List of items (JSON array of JSON objects) with their details.

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "viewcart",
	    parameters:{
 	        items:[
	            {
	                itemid:"54fg4",
	                price:24.21,
	                quantity:2, 
	                currency:"IDR"
	            },
	            {
	                itemid:"98ud-tr7-234",
	                price:123.65,
	                quantity:1,
	                currency:"IDR"
	             }
	        ]
	    }
 	});	
</script>

Purchase page

For the purchase page, the parameter action is purchase.

Provide the details of the cart:

  • items List of items (JSON array of JSON objects) with their details.

  • transactionid, the ID of the transaction for later reconciliation

This event has to be on the confirmation page, after validation of payment by the user.

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "purchase",
	    parameters:{
 	        items:[
	             {
	                 itemid:"54fg4",
	                 price:24.21,
	                 quantity:2, 
	                 currency:"IDR"
	              },
	              {
	                 itemid:"98ud-tr7-234",
	                 price:123.65,
	                 quantity:1,
	                 currency:"IDR"
	               }
	          ],
	          transcationid: "434jh323"
	     }
 	});	
</script>

Subscription

For the subscription page, the action is subscription.

It is called when the user subscribed to an offer or a service.

The property parameters contains the detail of the product/offer the user subscribed to.

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "subscription",
	    parameters:{
 		     itemid:"54fg4",
 		     price:"23.21", 
 		     currency:"USD",
 		     recurrence: "monthly"
 	    }
 	});	
</script>

Install

Triggered when a user install the application. Usually triggered by a tracking partner like Appflyer, Branch or Adjust. However it is still possible to trigger it from a webpage (for example a thank you page opened in webview in the application, or a pixel page in the application).

There is an additional parameter domain to pass the name of the application.

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "install",
        domain:"Name of the application"
 	});	
</

Sections and other pages

When the page is not one of the previously defined, it is still possible to use more generic viewsection or visit events.

Section page

For the sections (section.example.com or example.com/section), only provide the parameters action with value viewsection and the category of the section.

Example:

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
		action: "viewsection",
        category: "news",
 	});	
</script>

Other pages

For any other page, we consider that it is a visit to a page.

Provide the details of the page when possible (all are optional):

  • itemid: ID of the article (string)

  • keywords: array of strings

  • title: title of the page (string)

  • description: short description of the page (string)

  • category: the category of the page (string)

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
		action: ”visit",
	    parameters:{
 		    itemid:"54fg4",
 		    keywords:[”key1”,”key2”], 
 		    title:”Amazing article",
 		    description: ”This is a description”,
            category:”travel”,
 	    }
 	});	
</script>

Special action: add to cart

This action can take place anywhere on the website, on any page.

It is called when the user adds a product/offer to his cart. In that case just push a new element in jixie_p array. The parameter action is then addcart.

The property parameters contains the detail of the product/offer added to the cart.

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "addcart",
	    parameters:{
 		    itemid:"54fg4",
 		    price:"23.21", 
 		    currency:"USD",
 		    availability: "instock"
 	    }
 	});	
</script>

Special action: add a product/offer to the wish list

This action can take place anywhere on the website, on any page.

It is called when the user adds a product/offer to his favorites or the wish list. In that case just push a new element in jixie_p array. The parameter action is then addwishlist.

The property parameters contains the detail of the product/offer added to the wish list or favorites.

Example

<script type="text/javascript">
	window.jixie_p = window.jixie_p || []; 
	window.jixie_p.push({
	    action: "addwishlist",
	    parameters:{
 		    itemid:"54fg4",
 		    price:"23.21", 
 		    currency:"USD"
 	    }
 	});	
</script>