Customer Tracking

This post is also available in: Czech

In the following article, we will show you how to set up customer tracking on your website by connecting Samba and the Upgates platform.

Tracking code

In order for Samba to be able to track your customers’ purchasing behaviour and then personalize your communication based on this data, you need to have this tracking script on your website:

<!-- pixel -->
<script async src=""></script>

if (upgates.cookies.personalized) {

var _yottlyOnload = _yottlyOnload || []
_yottlyOnload.push(function () {
  if (upgates.customer) {
    diffAnalytics.customerLoggedIn('C' + String(, '0'));

  let cartContent = (cartItem) {
    return { productId: cartItem.code, amount: cartItem.quantity };
  diffAnalytics.cartInteraction({ content: cartContent, onOrderPage: ['order.checkout','order.recieved','order.summary'].indexOf(upgates.pageType) !== -1 });

  if (upgates.pageType === 'order.recieved') {
    let orderContent = (orderItem) {
      return { productId: orderItem.code, price: orderItem.price.withVat * orderItem.quantity };
    diffAnalytics.order({ content: orderContent });

  if (upgates.pageType === 'product') {
<!-- End pixel -->
Trackpoint ID

Attention! It is important to replace *YOUR_TRACKPOINT_ID* it with the numeric value of your TrackPoint, which you can find in Samba → Eshop Settings → Overview

Embedding code into the site

The above-mentioned script must be inserted into the administration of your eshop in Upgates.

In the left sidebar, open the Addons section and go to the Custom Conversion Codes.

Here, paste the entire script into the Code placed before the tag </body> in the </> Codes placed on all pages section and save the settings.

This post is also available in: Czech

Updated on November 1, 2022

Was this article helpful?

Related Articles