Tracking + Analytics

Optimize your app with measurement and analysis tools.

Criteo

Target ads at customers or potential customers who previously visited your mobile shop with the assistance of Criteo. To track activities in your native apps, use other tracking tools supported at Shopgate.

In this article, you will find everything you need to set up Criteo in your Shopgate mobile shop.

Locating the Tracking Code function

The Criteo tracking service can be implemented with the Shopgate Tracking Code function. To locate the Tracking Code function, follow the steps below:

  1. Log in to your Shopgate Admin page.
  2. Click Settings from the menu bar, then select Tracking Tools.



  3. On this page, you will find all the tracking tools and services supported at Shopgate. To set up Criteo, look for the section "Tracking codes" at the bottom of the page.
    To learn more about the Shopgate tracking codes, read Embedding a custom tracking code.

Embedding codes

To set up Criteo tracking, embed a tracking code in the following pages of your mobile website platform:

Available Platform Available Page
Smartphone

Start page (homepage)
Product list
Product detail page
Shopping cart
Checkout success

Tablet

Start page (homepage)
Product list
Product detail page
Shopping cart
Checkout success

 

Embedding codes in your smartphone platform

  1. Select Mobile Website Smartphone as the platform. Select a page listed here, then click +Add:
    • Start Page (homepage)
    • Product detail page
    • Product list
    • Shopping cart
    • Checkout Success
  2. An empty script editor will open. Paste the tracking code (shown below) accordingly. Replace the XXXX with your Criteo account ID.
  3. Repeat the steps until all four pages have been added.

Start Page (Homepage)

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{event: "setAccount", account: xxxxx},
	{event: "setSiteType", type: "m"}
);

if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
}

window.criteo_q.push(
	{event: "viewHome"}
);

var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);

Product detail page

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{event: "setAccount", account: xxxxx},
	{event: "setSiteType", type: "m"}
);

if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
}

window.criteo_q.push(
	{event: "viewItem", item: sgData.product.productNumber}
);

var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);

Product list

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{event: "setAccount", account: xxxxx},
	{event: "setSiteType", type: "m"}
);

if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
}

window.criteo_q.push(
	{event: "viewList", item: [
		sgData.products[0].productNumber,
		sgData.products[1].productNumber,
		sgData.products[2].productNumber
	]}
);

var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);
 

Shopping Cart

if (sgData.cart.productsCount > 0) {
window.criteo_q = window.criteo_q || [];
	window.criteo_q.push(
		{event: "setAccount", account: xxxxx},
		{event: "setSiteType", type: "m"}
	);
	
	if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
	}

	var critItems = []; 
	for ( var i in sgData.cart.products) {
		var prod = sgData.cart.products[i];
		var critItem = {
			id: prod.productNumber,
			price: prod.amount.gross,
			quantity: prod.quantity
		};
		critItems.push(critItem);		
	}

	window.criteo_q.push(
		{event: "viewBasket", item: critItems}
	);

	var kolCritJs = document.createElement("script");
	kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
	document.body.appendChild(kolCritJs);
} 

Checkout Success

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{ event: "setAccount", account: xxxxx },
	{ event: "setSiteType", type: "m" },
	{ event: "setEmail", email: sgData.order.user.email }
);
var critItems = []; 
for ( var i in sgData.order.products) {
	var prod = sgData.order.products[i];
	var critItem =
		{ id: prod.productNumber, price: prod.amount.gross, quantity: prod.quantity }
		;
	critItems.push(critItem); 
}
window.criteo_q.push(
	{ event: "trackTransaction", id: sgData.order.number, item: critItems}
);
var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);

 

Embedding codes in your tablet platform

  1. Select Mobile Webseite Tablet as the platform. Select a page listed here, then click +Add:
    • Start Page (Homepage)
    • Product detail page
    • Product list
    • Shopping cart
    • Checkout success
  2. An empty script editor will open. Paste the tracking code (shown below) accordingly. Replace the XXXX with your Criteo account ID.
  3. Repeat the steps until all four pages have been added.

Start Page (Homepage)

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{event: "setAccount", account: xxxxx},
	{event: "setSiteType", type: "t"}
);

if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
}

window.criteo_q.push(
	{event: "viewHome"}
);

var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);

Product detail page

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{event: "setAccount", account: xxxxx},
	{event: "setSiteType", type: "t"}
);

if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
}

window.criteo_q.push(
	{event: "viewItem", item: sgData.product.productNumber}
);

var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);

Product list

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{event: "setAccount", account: xxxxx},
	{event: "setSiteType", type: "t"}
);

if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
}

window.criteo_q.push(
	{event: "viewList", item: [
		sgData.products[0].productNumber,
		sgData.products[1].productNumber,
		sgData.products[2].productNumber
	]}
);

var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);

Shopping Cart

if (sgData.cart.productsCount > 0) {

	window.criteo_q = window.criteo_q || [];
	window.criteo_q.push(
		{event: "setAccount", account: xxxxx},
		{event: "setSiteType", type: "t"}
	);
	
	if(sgData.user.loggedIn === true){
	window.criteo_q.push(
		{event: "setEmail", email: sgData.user.email }
	);
	}

	var critItems = []; 
	for ( var i in sgData.cart.products) {
		var prod = sgData.cart.products[i];
		var critItem = {
			id: prod.productNumber,
			price: prod.amount.gross,
			quantity: prod.quantity
		};
		critItems.push(critItem);		
	}

	window.criteo_q.push(
		{event: "viewBasket", item: critItems}
	);

	var kolCritJs = document.createElement("script");
	kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
	document.body.appendChild(kolCritJs);
}

Checkout Success

window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
	{ event: "setAccount", account: xxxxx },
	{ event: "setSiteType", type: "t" },
	{ event: "setEmail", email: sgData.order.user.email }
);

var critItems = []; 
for ( var i in sgData.order.products) {
	var prod = sgData.order.products[i];
	var critItem =
		{ id: prod.productNumber, price: prod.amount.gross, quantity: prod.quantity }
		;
	critItems.push(critItem); 
}

window.criteo_q.push(
	{ event: "trackTransaction", id: sgData.order.number, item: critItems}
);
var kolCritJs = document.createElement("script");
kolCritJs.src = '//static.criteo.net/js/ld/ld.js';
document.body.appendChild(kolCritJs);

That's it! You have successfully set up your tracking codes.

For a better understanding on the tracking codes function and all its options, please read Embedding a custom tracking code.

 

Was this article helpful?
Can't find what you're looking for?
Let us help you—submit a support ticket.
Contact Support