fr | en | es | de

Goals and sales

New!
Discover the latest tools in the
Analytics Suite, thanks to our new online help.

Contents: Hide

All of the information described in this document requires the 3.2.001 version or later of the xtcore.js file. This file is available:

Subscribing to the SalesTracker module provides you with a solution that is perfectly adapted to your business needs.

There is also the possibility of customising SalesTracker depending on your business activity:

Note

This document deals with tagging for all types of sites (e-Commerce, online travel, e-Ads). The terminology which is used can be applied to the different types of sites, and this is why, for example, we use the terms “Order/Booking”.

Irrespective of your e-Commerce activity (online sales, online shop, travel agency), the aim is to retrieve information from online sales and then to analyse the information.

This tagging guide deals with the different steps involved in the implementation of the SalesTracker module:

Tagging goal pages

Measuring main goal pages (WITHOUT the SalesTracker option)

Even without the SalesTracker option it is possible to measure the order confirmation page (main goal) by inserting the total value of the order (xt_roimt) as well as the order number (xt_orderid).

 

For example:

<script type="text/JavaScript">

<!--

xt_orderid= "8235";                           //order ID

xt_roimt= "2049";                             //Sales Turnover indicator

//do not modify below

if (window.xtparam!=null) {window.xtparam+="&cmd="+xt_orderid+"&roimt="+xt_roimt;}

else {window.xtparam="&cmd="+xt_orderid+"&roimt="+xt_roimt;}

</script>

 

Order number 8235 was processed for a total of €2,049.

Measuring main goal pages (WITH the SalesTracker option)

The tag placed on your website must send all information, which is linked to the purchasing process, to our servers (in addition to the data already generated):

These tags are only measured on main goal pages.

 

The order/booking (main goal)

Here is an example of an order tagging code (e-Commerce activity):

 

<script type="text/JavaScript">

<!--

xtidcart="123456";

xt_orderid= "8235";                           //order ID

xt_roimt= "2049";                             //Sales Turnover indicator

xt_totalATI= "2049";                          //order amount (all taxes included)

xt_totalTF= "1649.36";                        //order amount (tax free)

xt_discountATI= "9.9";                        //discount amount (all taxes included)

xt_discountTF= "7.96";                        //discount amount (tax free)

xt_newcus= "1";                               //is this a new customer? 1/0

xt_shipATI = "19.9";                          //shipping cost (all taxes included)

xt_shipTF = "16";                             //shipping cost (tax free)

xt_tax ="339.64";                             //tax

xt_paym = "1";                                //payment method

xt_status = "1";                              //order status

xt_delivery = "1[Colissimo]";                 //delivery method

xt_promocode= "CDPR15485Q";                   //promo code

xt_ordermc = "&o1=5&o2=30&o3=14&o4=[contact tel]&o5=1";

 

//do not modify below

if (window.xtparam!=null) {window.xtparam+="&cmd="+xt_orderid+"&newcus="+xt_newcus+"&roimt="+xt_roimt+"&mtht="+xt_totalTF+"&mtttc="+xt_totalATI+"&fp="+xt_shipATI+"&fpht="+xt_shipTF+"
&tax="+xt_tax+"&mp="+xt_paym+"&st="+xt_status+"&dl="+xt_delivery+"&pcd="+xt_promocode+"&dsc="+xt_discountATI+"
&dscht="+xt_discountTF+"&idcart="+xtidcart+xt_ordermc;}

else {window.xtparam="&cmd="+xt_orderid+"&newcus="+xt_newcus+"&roimt="+xt_roimt+"&mtht="+xt_totalTF+"&mtttc="+xt_totalATI+"&fp="+xt_shipATI+"&fpht="+xt_shipTF+"
&tax="+xt_tax+"&mp="+xt_paym+"&st="+xt_status+"&dl="+xt_delivery+"&pcd="+xt_promocode+"&dsc="+xt_discountATI+"
&dscht="+xt_discountTF+"&idcart="+xtidcart+xt_ordermc;}

</script>

 

Explanation: An order for the total amount of €2,049, all taxes included, has been placed. The total amount can be broken down as follows: (€1,649.36 before tax), with a €9.90  discount (€7.96 before tax). The total cost includes shipping fees of €19.90 (€16 before tax). The payment was made with a credit card. Furthermore, the order status is "Pending", the customer used the promotional code CDPR15485Q, and the method of delivery is "Colissimo" (registered post).

Important

The standard tag must be linked to the order tag. This tag allows you to add customer ID through the xt_an and xt_ac variables. If this ID has already been entered on another page, during the same visit, then it is not necessary to enter the information again.
The order discount is integrated by using the following variables: xt_discountATI and xt_discountTF.

The "xt_roimt" variable (required) represents the main sales variable that you want to display in your analyses (Source analyses in particular). Therefore, you need to assign a value to this variable depending on your needs.

Note

In the above example, the value assigned to the variable xt_roimt corresponds to the total (after tax). However, you can also choose to assign a value that does not include taxes or shipping fees. You define what the main sales variable should be, depending on your activity and your requirements.

Order-specific variables: order totals (xt_totalATI and xt_totalTF) are separate from the amount that is used in the Sources analyses (xt_roimt). Therefore, we differentiate between accounting variables (before tax and after tax) for the SalesTracker module and for the xt_roimt, whose value can be customised and which does not change for analyses in the interface.


*Order and product discounts

Discounts:
xt_discountATI and xt_discountTF variables (before tax and after tax) represent a “total” discount which is applied to an order.

In the following paragraph you can see that discounts can also be applied to the product (=order content).

Important

The discount total which is to be entered must be the sum of all of the products which have been purchased
For example the unit price of a product is "€100" and the number of these products which have been purchased is "2", then by using this information there are a different number of cases which can arise.

* The product discount is applied to a specific quantity of products that is purchased for example "a €15 discount for 2 products purchased".
In this example the retrieval code to be used is as follows:
xt_addProduct_v2("Category structure","ID1[product]","2","100 ","unit price (before tax)" ,"15" ,"discount (before tax)","discount code","185");

* If the discount to be applied is as follows: "10% off this product, regardless of the quantity ordered" the final discount that is to be applied depends on the quantity ordered. In this example the retrieval code to be used is as follows
xt_addProduct_v2("Category structure","ID1[product]","2","100","unit price (before tax)" ,"20" ,"discount (before tax)","discount code","180");

 

Order/booking content (main goal)

The model below is a code which is used to retrieve information about an order's content or the content of a shopping basket (for an e-Commerce activity):

 

 <script type="text/javascript"> <!--

function xt_cart()

{

                xt_addProduct_v2("Category structure","ID1[product]","quantity","unit price (tax included) ","unit price (before tax)" ,"discount (tax included)" ,"discount (before tax)","discount code","total sale");

}

//--></script>

 

The xt_cart function (called in the xtcore.js file) contains X times the xt_addProduct_v2 function (one call per product of the order content).

This function includes all of the variables that it contains in the hit. This construction must be done dynamically: it is possible to call the xt_addProduct_v2 function as many times as necessary.

Important

Product IDs are compulsory, whereas product category IDs are optional. They are unique, unlike sub-category IDs, which can be used several times with a distinct label. For example, you can use 1[Category]::1[other_category] but you cannot use 1[Category]::1[category2] and 1[Other_Category]::1[category2].

If you do not enter a label for the category (ID only), the label will be displayed on the interface as "#ID".

Example:

 

<script type="text/javascript">

<!--

function xt_cart(){

xt_addProduct_v2("1[Computers_and_Networking]::25[Computers]::56[Laptops]","564[laptop_ACER_A56]","1","549",

"456.22","10","8.04","Offer_New_Customer","549");

}

//-->

</script>

 

Explanation: there is only one product in the order,

This order allows you to add the following categories:

Note

In order to determine the sales figure by category, it is necessary to enter the category as part of the order content.

Measuring confirmation pages on external sites (WITH the SalesTracker option)

The aim here is to be able to measure order/booking validations, in spite of the fact that the confirmation page is hosted by an external website (bank payment platforms).

We suggest that you simulate a tag when your website receives the payment confirmation from an external website:

Step 1: the Internet user leaves your website in order to proceed with payment on the external website (bank).

Step 2: the Internet user validates their payment, which is accepted. The bank then sends the validation notification to your website.

Step 3: your website validates the order while calling the tag URL.

 

Server-side tag

The scenario shown above requires the implementation of specific tags:

* Integration on the page which precedes the page that redirects users to the payment site.

In order to link the hit sent by the server to the Internet user’s visit (and to their order content), it is necessary to integrate some complementary information on the page which precedes the page that redirects users to the payment site.

It is therefore suitable to add all of the lines of code relating to the order/booking, the order/booking content just above the tag (containing the xtsite, xtn2 settings etc), as well as the following lines of code:

 

<script type="text/javascript">

<!--

xttp = "pre1";

xtidcart = "" ;

//do not modify below

if (window.xtparam!=null){window.xtparam+="&tp="+xttp+"&idcart="+xtidcart}

else{xtparam = "&tp="+xttp+"&idcart="+xtidcart};

//-->

</script>

 

Note

xtidcart contains the order/booking content number, or the order/booking number if it is known at this step.

Once the payment has been made, you will receive notification of the confirmation of cancellation of payment. Synchronization occurs (through the website or other techniques) between the actual payment process on the external site and your database in order to obtain order/booking payment information.

This is where a second tag must be used, so that the order can be considered as being valid.

 

*Integration into an ASPHTTP call:

A classic tag is a piece of JavaScript code which is called directly from a customer's workstation, i.e. an Internet user's workstation.

It is the server which hosts the website that directly calls the tag. Since the JavaScript requires HTML code to be generated (code which is not generated by the server at this time) the tag is directly called via its URL, without any JavaScript. For example:

http://logxxxx.xxxx/hit.xiti?s=&s2=&p=&tp=conf1&idcart=&cmd=&

 

The different parameters of this tag are as follows:

Important

- The idcart parameter of this call must contain the same value as the xtidcart mentioned earlier. This correspondence means that a hit can be linked to the correct visit.
- The parameter p must be entered, if not the hit will be ignored.

Example of use:

In the following example, the following points must be taken into consideration:

Here is a tag example:

 

<script type="text/JavaScript">

<!--

xttp="pre1";

xtidcart="123";

xt_orderid= "";               //order ID

xt_roimt= "1910";                 //Sales Turnover indicator

xt_totalATI= "1910";              //order amount (all taxes included)

xt_totalTF= "1600.27";            //order amount (tax free)

xt_discountATI= "9.9";            //discount amount (all taxes included)

xt_discountTF= "7.96";            //discount amount (tax free)

xt_newcus= "1";                   //is this a new customer? 1/0

xt_shipATI = "20";                //shipping cost (all taxes included)

xt_shipTF = "16.08";              //shipping cost (tax free)

xt_tax ="313.65";                 //tax

xt_paym ="1";                     //payment method

xt_status = "1";                  //order status

xt_delivery = "1[Colissimo]";     //delivery method

xt_promocode= "CDPR15485Q";       //promo code

xt_ordermc = "&o1=[FR]&o2=[GB]&o3=14&o4=[Travel1]&o5=1";

 

//do not modify below

if (window.xtparam!=null) {window.xtparam+="&cmd="+xt_orderid+"&newcus="+xt_newcus+"&roimt="+xt_roimt+"&mtht="+xt_totalTF+"&mtttc="+xt_totalATI+"&fp="+xt_shipATI+"&fpht="+xt_shipTF+"
&tax="+xt_tax+"&mp="+xt_paym+"&st="+xt_status+"&dl="+xt_delivery+"&pcd="+xt_promocode+"&dsc="+xt_discountATI+"&dscht="+xt_discountTF+"
&tp="+xttp+"&idcart="+xtidcart+xt_ordermc;}

else {window.xtparam="&cmd="+xt_orderid+"&newcus="+xt_newcus+"&roimt="+xt_roimt+"&mtht="+xt_totalTF+"&mtttc="+xt_totalATI+"&fp="+xt_shipATI+"&fpht="+xt_shipTF+"
&tax="+xt_tax+"&mp="+xt_paym+"&st="+xt_status+"&dl="+xt_delivery+"&pcd="+xt_promocode+"&dsc="+xt_discountATI+"&dscht="+xt_discountTF+"
&tp="+xttp+"&idcart="+xtidcart+xt_ordermc;}

</script>

 

Note

- The values of amount, order numbers, shipping fees, order content number, etc are given as examples.
- If the order number or the "order status" is not known, you can leave these 2 variables (xt_orderid and xt_status) blank, and enter them in the code which is sent from the bank (st= and cmd=).

Your website’s page, which is called by the external website during payment validation, must not contain the tag, only the image call.
 

Example in ASP:

<%

'Code corresponding to the database update

‘Example with the ASPHTTP component

Set HttpObj = Server.CreateObject("AspHTTP.Conn")

HTTPObj.Url = " http://logxxxx.xxxx/hit.xiti?s=999999&s2=&p=payment_validated&tp=conf1&idcart=123&cmd=AZ234BG67&st=1"

strResult = HTTPObj.GetURL

‘Remainder of page code

%>

 

Example in JSP:

try{

java.net.URL url = new java.net.URL("http://logxxxx.xxxx/hit.xiti?s=999999&s2=&p=payment_validated&tp=conf1&idcart=123&cmd=AZ234BG67&st=1");

((java.net.HttpURLConnection)url.openConnection()).getResponseMessage();               

}

catch(Exception ex){       

}      

 

Example in PHP:

<?php $url = "http://logxxxx.xxxx/hit.xiti?s=999999&s2=&p=payment_validated&tp=conf1&idcart=123&cmd=AZ234BG67&st=1";$fd = fopen ($url, "r"); fclose ($fd);?>

Important

- The xtidcart and idcart refer to the order tag with the PRE1 and the CONF1 tags respectively. They must be identical. This equivalence makes it possible to associate ALL of the order content data with the final order.
- All of the values of the variables are given as examples, except “tp=conf1” (in red) which must not be modified.
- st=1 makes it possible here, for example, to indicate that the order is “Pending”.

Note

Some of the variables may be modified as the conf1 hit is being sent; if this is the case it will be the values of the variables added to the conf1 hit which will take precedence over the variables which are part of the pre1 hit.
The following variables are concerned: cmd (order number), roimt (order total), mtht (order total excluding tax), mttc (order total including tax), mp (payment method), st (order status).

 

 

 

Updating orders (WITH the SalesTracker option)

The order update tag allows you to revise sales turnover and to take into consideration any changes which have been made to order statuses and to order totals after a purchase has been made on your web site (for example orders paid by cheque, returned orders, a price change or a donation pledge, etc.

Note

Unlike the Server side tag, an order can be updated up to 60 days after it first appears on the interface. Beyond this 60 day period, any update request will not be considered.

Here is the tag:

http://[LOG]xxxx.xxxx/hit.xiti?typehit=updateorder&s=[SITENUM]&guid=[GUID]&cmd=[ORDERNUM]&st=[STATUS]&roimt=[TOTAL]&mtht=[TOTALEXCLTAX]&mtttc=[TOTALINCTAX]

 

Please find below a list which contains the different variables included in the tag:

Note

The "s", "log" and "typehit" parameters should not be changed.

Important

The order status and order total can be modified independently of one another. It is therefore possible to change an order total without this change affecting the order status and vice-versa.
If information has been entered to one of the three total fields, then the 3 totals will be updated as part of the data that is available on your interface.
The update date tag is only applicable to main goals with an order number.

Measuring "aisles viewed" and "entry aisles" (WITH the SalesTracker option)

This is a navigation analysis which is specific to e-Commerce sites, and which allows you to categorise the pages of your site on which products are sold. Such categories may include a new collection of products, products which are on special offer etc. The aim of this analysis is to have an overall vision of the different aisles that Internet users visit on your site.

In order to measure the aisles which have been visited you need to add a few lines of JavaScript code to the pages which belong to a particular aisle.

In the JavaScript variable, "xt_aisle", you need to provide information on the different aisle levels that are available, bearing in mind that the number of aisle levels can reach up to 6, as shown in the tag below:

<script type="text/javascript">

<!--

xt_aisle = ""; //Aisles (with 6 levels possible (::))

//do not modify below

if (window.xtparam!=null){window.xtparam+="&aisl="+xt_aisle;}

//-->

</script>

Note

The aisle ID may also correspond to the category ID (SalesTracker).

For example, the aisle "Laptop computers" belongs to the following aisles: High Tech>Computers and Networks>Computers>Laptops :

<script type="text/javascript">

<!--

xt_aisle = "10[high_tech]::20[Computers_network]::30[Computers]::40[Laptops]"; //Aisles (with 6 levels possible (::))

//do not modify below

if (window.xtparam!=null){window.xtparam+="&aisl="+xt_aisle;}

//-->

</script>

 

This measurement provides the traffic volume for the aisles viewed, irrespective of whether the measurement is carried out at the beginning of a visit or during a visit. Please bear in mind that it is possible to have up to 6 different aisle levels. The total sales figure which this traffic volume may generate from the same visit is also available.

Measuring "purchased products" and "abandoned products" (WITH the SalesTracker option)

This analysis allows you to consult the list of products which have been abandoned.

A tag which is used to consult shopping baskets therefore needs to be implemented.

To obtain information on the abandoned products, you need to insert all of the products (contained in the basket) into a shopping basket consultation page by using the same IDs as the products which can be found on the order confirmation page.

<script type="text/javascript">

<!--

xttp = "cart";

xtidcart="123";//transaction ID

xt_an = ""; //numeric identifier

xt_ac = ""; //category

function xt_cart(){

xt_addProduct_v2("Category structure1","ID1[product1]","quantity1","unit price 1");

xt_addProduct_v2("Category structure2","ID2[product2]","quantity2"," unit price 2");

} //do not modify below

if (window.xtparam!=null){window.xtparam+="&tp="+xttp+"&idcart="+xtidcart+"&ac="+xt_ac+"&an="+xt_an;}

else{window.xtparam ="&tp="+xttp+"&idcart="+xtidcart+"&ac="+xt_ac+"&an="+xt_an;};

//-->

</script>

Important

All of the products as well as their respective categories are compulsory.
The shopping basket's ID must be entered (xtidcart). The xtidcart variable which is added to this tag must be identical to the one that is used in the order content tag; if this is not the case the shopping basket will be considered as being abandoned. We would also like to point out that the value used for the xtidcart variable must be UNIQUE and must NEVER BE REUSED to avoid incoherent analyses from being generated. Should you use the "ServerSide" tag (a tag which can be used to measure confirmation pages on banking websites) which also contains the xtidcart variable, please remember that it will always be the last item added to a shopping basket that will be analysed (entered as follows xttp="pre1").
The client ID is optional.

Attention

This measurement excludes clicks which have been made on the "Add to shopping basket" button.

It is also possible to find out which products and which categories of products have been purchased and abandoned the most. It will also be possible to have an idea of what your potential sales figures are going to be.

Thanks to the use of the DataExplorer module, it is possible to cross this information with customer ID and the destination ID of the email marketing campaign

Customising your measurement (WITH the SalesTracker option)

In order to benefit from this feature, you must correctly insert an order/booking tag on your site.

However, a shopping basket tag (xt_addProduct_V2) is not required. This feature is compatible with the Server-side tag (on a PRE1 page).

In addition to the selection of a global profile, depending on your area of business activity (e-Commerce, online travel, e-Ads), you have the possibility of enhancing your customised measurements even further by using the specific variables in your source code.

Before tagging, we suggest that you define variables which play a crucial role in your site conversion.

Example

For an e-Commerce site, you can add the following variables:
- Shipping
- Customer age
- Title, etc.

We suggest that you define some custom variables which are specific to your company and/or your needs. This information is then available in your analyses and is described by e-Commerce variables.

There are different aims associated with adding new analyses variables:

Integrating order/booking variables

Step 1: declare variables

Step 2: page tagging

You then have to insert the following tag into your source code by entering all of the values contained in the xt_ordermc variable.

 

<script type="text/JavaScript">

<!--

xt_ordermc="&o1=Value_O1&o2=Value_O2&o3=Value_O3&o4=Value_O4&o5=Value_O5";

if(window.xtparam!=null){window.xtparam+=xt_ordermc;}

else{window.xtparam = xt_ordermc;};

//-->

</script>

 

Types of variables

A variable can be available in different formats: text, numeric, date, duration or country.

Note

The integration value of some variables requires you to import an Excel file (xls) or CSV, through a reference table. This operation must be carried out directly from the Configuration zone of the interface.

The variable "Identifier" is characterised by a piece of information which groups several values together.

Example

The "Language" variable is made up of sub-information: "French", "English", "Spanish", etc.

As with the "ID"/"Date" variable, you can add "Text" custom variables by completing the table. The main advantage here is that you can retrieve values which can be read immediately in your analyses.

"Value" variables are capable of retrieving information which can be added together. An average can also be calculated.

This type of variable allows you to insert information linked to your business activity.

It can also create variables that can be added together (or average variables) in your analyses.

Example

Duration variable per activity:
online travel: Time-to-Look
online travel: Time-to-Book
online travel: Travel duration
e-Commerce: Delivery time
e-Ads: Ad lifespan

"Country" variables allow you to adapt the analyses to your business activity.

Example

Online travel : Departure country/Destination country
e-Commerce/ e-Ads: Invoice country/Shipping country

Note

"Text" and "Country" variables must be typed between brackets. The ISO standards are used to tag countries. You can retrieve the ISO codes through the Configuration zone of your interface.

All of these different types of variables are similar to those used in the "Global variables" and "Page variables". The declaration and implementation methods are the same.

Examples of customised tagging

Example 1

A travel website offers trips with a variable duration in approximately twenty destination countries.

5 variables are declared:

Here is the tag code to be inserted:

 

<script type="text/JavaScript">

<!--

xt_ordermc="&o1=[FR]&o2=[GB]&o3=15&o4=53&o5=3;

if(window.xtparam!=null){window.xtparam+=xt_ordermc;}

else{window.xtparam = xt_ordermc;};

//-->

</script>

 

During the travel booking, you can get the following information:

Note

The variable o5 (travel type) is represented by an identifier because it includes several values (which are integrated into correspondence tables that have been previously imported).

Example 2

Example of a complete tag code which integrates all of the variables used in the SalesTracker module, and in particular the order variable tag previously mentioned:

 

<script type="text/JavaScript">

<!--

xt_orderid= "8235";                 //order ID

xt_roimt= "2049";                   //Sales Turnover indicator

xt_totalATI= "2049";                //order amount (all taxes included)

xt_totalTF= "1649.36";              //order amount (tax free)

xt_discountATI= "9.9";              //discount amount (all taxes included)

xt_discountTF= "7.96";              //discount amount (tax free)

xt_newcus= "1";                     //is this a new customer? 1/0

xt_shipATI = "19.9";                //shipping cost (all taxes included)

xt_shipTF = "16";                   //shipping cost (tax free)

xt_tax ="339.64";                   //tax

xt_paym ="1";                       //payment method

xt_status = "1";                    //order status

xt_delivery = "1[Colissimo]";       //delivery method

xt_promocode= "CDPR15485Q";         //promo code

xt_ordermc = "&o1=5&o2=30&o3=14&o4=[contact tel]&o5=1";

 

//do not modify below

if (window.xtparam!=null) {window.xtparam+="&cmd="+xt_orderid+"&newcus="+xt_newcus+"&roimt="+xt_roimt+"&mtht="+xt_totalTF+"&mtttc="+xt_totalATI+"&fp="+xt_shipATI+"
&fpht="+xt_shipTF+"&tax="+xt_tax+"&mp="+xt_paym+"&st="+xt_status+"&dl="+xt_delivery+"&pcd="+xt_promocode+"&dsc="+xt_discountATI+"
&dscht="+xt_discountTF+xt_ordermc;}

else {window.xtparam="&cmd="+xt_orderid+"&newcus="+xt_newcus+"&roimt="+xt_roimt+"&mtht="+xt_totalTF+"&mtttc="+xt_totalATI+"&fp="+xt_shipATI+"
&fpht="+xt_shipTF+"&tax="+xt_tax+"&mp="+xt_paym+"&st="+xt_status+"&dl="+xt_delivery+"&pcd="+xt_promocode+"&dsc="+xt_discountATI+"
&dscht="+xt_discountTF+xt_ordermc;}

 

function xt_cart(){

xt_addProduct_v2("1[Computers_and_Networking]::25[Computers]::56[Laptops]","564[laptop_ACER_A56]","1","549",

"456.22","10","8.04","Offer_New_Customer","549");

}

//-->

</script>

 

ico_up.gif