Support Twenga Solutions

        

Installation instructions for V2 Tracking

 I - The script and its settings

The tracking is designed to be present on your order confirmation page, also called transaction page.

The tracking script is compatible with all your webpages, no matter whether your website is using the https or the http protocols..

The tracking is made up of:

  • an HTML element (an invisible « twcm_main » div) in which you will need to add information.
  • a javascript code(asynchronous)which reads the HTML data and sends it to Twenga's tracking server.

To benefit from Twenga’s performance optimizations based on conversion and best-selling product ranking, you will need to integrate and configure the tracking script in your website's source code (Section 2: Integration and Configuration)

II - Tracking script integration and configuration

To configure the "Twenga Tracking Script", you need to be using the Twenga Solutions -  Smart LEADS program(https://www.twenga-solutions.com/fr/signup)

Your one-of-a-kind 'key/hashkey' is available in your account at this address My account in the 'Hashkey authentication code' section

You will also need to have access to your website's source code.

 

Note : If you already use an older version of the "Twenga Tracking Script" code, make sure that you delete it before adding the new one.

To add the "Twenga Tracking" extract code to your website, follow the instructions below:

1 - JavaScript Code

The code you need to copy can be found below:

<script async="true" language="javascript" type="text/javascript" src="//tracker.twenga.{TLD}/tracker.js"></script>

TLD depends on the country’s programme you are subscribed to. If you subsribe for www.twenga.co.uk, .{TLD}/ has to be replaced by .co.uk/; so, you should have:

<script async="true" language="javascript" type="text/javascript" src="//tracker.twenga.co.uk/tracker.js"></script> 

Copy and paste this code on your order confirmation page, just before the closing tag </head>.

One of the main advantages of using an asynchronous code (async attribute="true" in the script code's markup) is that this script will not obstruct the loading of your pages.

2 - The HTML component

We recommend that you insert the above HTML code before the </body> markup, so that the loading time of your webpages is not impacted.

This piece of the tracking code contains some data that depends on the activity of your website's users. Such data must be dynamically calculated and provided in the HTML element.

a - Variables

Important :

The Twenga tracking enables the matching of products viewed by your website’s visitors with these published on the Twenga website through your product feed.

In order for the tracking to work properly, it is of the utmost importance to use exactly the same product IDs in your Twenga product feed and your Twenga tracking. Especially if your product feed is developed by a third party, make sure to double check this point!

The fields concernes are twcm_ref_id et twcm_item_id:

Tag Type Example Description
twcm_key string 98bcc090709d98402d172623970aa1ec Identifier of your site
twcm_event string transaction  
twcm_order_id string AB12345 Unique identifier of the transaction. Must be unique
twcm_order_currency string EUR Order Currency - ISO 4217 3-letter code
twcm_order_amount_et float 100.00 Amount excluding all taxes of the transaction: excluding shipping fees, including all services (insurance, ...)
twcm_ref_id ** string pumps123 Product style or generic reference identifier.
For a product that can have several variants (ex: size, colour, ...), this is the root identifier of the reference that contains all the variants. Read below for more details.
twcm_item_id ** string pumps123-red-38 Product single variant identifier.
For a product that can have several variants (ex: size, colour, ...), this is the identifier of a single variant. Read below for more details.
twcm_item_name string Pumps XYZ Item Designation
twcm_item_price_et float 100.00 Unitary price of the item, excluding taxes.
Note: While excluding taxes is preferred for performances measurement, including taxes is accepted.
twcm_item_quantity integer 3 Quantity of the same item in the order

Note : Please use the "." separator for floating point numbers.

** About twcm_ref_id and twcm_item_id product identifiers

1) twcm_ref_id and twcm_item_id values must be exactly the same as item_​group_​id and id values, respectively, in your product feed. 

2) Whether you need to use these 2 fields or not depends on the organisation and the presentation of your product catalog on your website.

In any case, your products necessarily have an item_id (or id), for example the final product SKU as listed in your client’s order

A ref_id (or item_​group_​id) however, will only be necessary when your products are organised in reference and product variants. (eg: a pair of shoes available in several colors and sizes).
In such case, a set of variants with the same reference is represented by 1 ref_id and several item_id (1 for each variant).
 

b - HTML Code 

In the below HTML code elements we provide, the variables to replace by dynamic values are identified in curly braces. For example: Replace {ITEM_ID} by the ID of your item to set the tag twcm_item_id

This code has to be inster on the Transaction page, or Order confirmation page. A Transaction page, or Order confirmation page, is a webpage that shows the contents of an order that has been validated in the checkout process. The specific code, which you have to insert before the </body> markup, for this type of page is: 

<div id="twcm_main"style="display:none;">

    <div class="twcm_key">{HASHKEY} </div>

    <div class="twcm_event">transaction</div>

    <!-- Unique order identifier -->

    <div class="twcm_order_id">{ORDER_ID}</div>  

    <!-- Transaction total amounts -->

    <div class="twcm_order_currency">{ORDER_CURRENCY}</div>

    <div class="twcm_order_amount_et">{ORDER_AMOUNT_ET}</div> <!-- total tax excluded -->

 <!-- Purchased items -->

    <div class="twcm_item">

        <div class="twcm_item_id">{ITEM_ID}</div> <!-- id in your feed -->

       <div class="twcm_ref_id">{REF_ID}</div> <!-- item_group_id in your feed -->

      <div class="twcm_item_name">{ITEM_NAME}</div> <!-- optional -->

      <div class="twcm_item_price_et">{ITEM_PRICE_ET}</div>

      <div class="twcm_item_quantity">{ITEM_QUANTITY}</div>

    </div>

    <!-- ... -->

    <div class="twcm_item">

        <div class="twcm_item_id">{ITEM_ID}</div> <!-- id in your feed -->

       <div class="twcm_ref_id">{REF_ID}</div> <!-- item_group_id in your feed -->

      <div class="twcm_item_name">{ITEM_NAME}</div> <!-- optional -->

      <div class="twcm_item_price_et">{ITEM_PRICE_ET}</div>

      <div class="twcm_item_quantity">{ITEM_QUANTITY}</div>

    </div>

</div>

Note : To ensure the exact tracking of your sales, it is important to insert this script on a page that is fully loaded during the checkout process of your customers. Do not integrate the script in a transitory page or on an automatic redirection page.

Here is an example of an integration on the transactin page :

<html lang="en-EN">
<head>
<meta charset="UTF-8"/>
<script language="javascript" type="text/javascript" async="true" src="//tracker.twenga.co.uk/tracker.js"></script>
</head>
<body>
  ...

<div id="twcm_main"style="display:none;">

    <div class="twcm_key">97bcc090709d98402d172623970aa1ec</div>

    <div class="twcm_event">transaction</div>

    <!-- Unique order identifier -->

    <div class="twcm_order_id">48626</div>  

    <!-- Transaction total amounts -->

    <div class="twcm_order_currency">GPB</div>

    <div class="twcm_order_amount_et">520.00</div> <!-- total tax excluded -->

 <!-- Purchased items -->

    <div class="twcm_item">

        <div class="twcm_item_id">TB32</div> <!-- id in your feed -->

       <div class="twcm_ref_id">TB</div> <!-- item_group_id in your feed -->

      <div class="twcm_item_name">Tablet 32Gb</div> <!-- optional -->

      <div class="twcm_item_price_et">500.00</div>

      <div class="twcm_item_quantity">1</div>

    </div>

    <!-- ... -->

    <div class="twcm_item">

        <div class="twcm_item_id">UC1</div> <!-- id in your feed -->

       <div class="twcm_ref_id">UC</div> <!-- item_group_id in your feed -->

      <div class="twcm_item_name">USB Blue Cord</div> <!-- optional -->

      <div class="twcm_item_price_et">10.00</div>

      <div class="twcm_item_quantity">2</div>

    </div>

</div>

2 - Validation and Support

Once you have completed the setup of your tracking script, let us know at support.merchant@twenga-solutions.com and we will validate it for you.

Also, if you encounter any problems while setting up your tracking script, send us your details to the support.merchant@twenga-solutions.com.

Our teams will guide you through the implementation of the tracking script on your website.

 

Have more questions? Submit a request
Twenga Solutions

Nous proposons des solutions d’acquisition de trafic avancées pour plus de 4 000 clients dans 15 pays. Localiser nos bureaux ⤍

Twenga Solutions

We provide advanced traffic acquisition solutions for over 4,000 customers in 15 countries. See our offices ⤍

Révolutionnez votre acquisition clients !

Contactez-nous

Join the smart acquisition revolution!

Contact us