Conversion Tracking Implementation: Guide for shops
- 1 Why conversion tracking?!
- 2 Click out: Additional Parameters
- 3 Data Structure: Conversion Targets and Tracking Categories
- 4 Conversion tag
- 4.1 Types of tags
- 4.1.1 JavaScript
- 4.1.2 Image Pixel
- 4.1.3 S2S Callback
- 4.2 Mandatory parameters
- 4.3 Optional parameters (frequently used)
- 4.4 Basket tracking
- 4.1 Types of tags
- 5 The onpage tag
- 6 Cookies and data protection
- 7 Tracking quality
Why conversion tracking?!
Conversion tracking allows to attribute sales and events to traffic sources. Then as the next step the attribution of monetary value to the registered events and sales is possible (rating). This means for example to pay a commission for a tracked sale.
Reports of collected conversion data allow judgements and analysis of performance, developments, costs, amounts and potentials for optimization.
Basis for all data collection and analysis is the implementation of a conversion tracking tag on the confirmation page that is displayed after completion of the sale.
in a nutshell
conversion tracking connects clicks and sales, that were registered via a tracking tag.
Click out: Additional Parameters
For the analysis of your traffic in other systems like Google Analytics, the Ingenious systems automatically can add parameters (e.g. UTM parameters) to links and redirects.
Values of the parameters can have
static values (e.g.
utm_source=affiliate
)dynamic values (e.g.
utm_source=#{PARTNER_ID}
, the partner id of the corresponding partner)
You can find the additional parameter tool under Manage Advertisers > Advertiser Tracking .
The Click Id
An important parameter for a functioning tracking is the click id. It works as a fallback, in case no cookie could be found. Especially in third party contexts (that means the tracking domain is a different one than the shop domain), the clickId is highly important to get tracking reliably working,.
All settings and configurations regarding the clickId should be done before implementing the tracking tags. Reason is, that the clickId needs to be included in the conversion tag and thus should be available, when it is implemented.
Details about receiving a transmitted clickId, saving it and fetching it to include it in the tag can be read here. It looks like this (example)
https://www.shop.com/cli=LIST_of_Click_IDs
Rare exception
In (usually very rare) cases, where you need to set up the transmission of the click id manually (for example if a certain specific parameter is needed, you may do the set up manually.
1. set up the click id as additional parameter: First, create the click id parameter that will be added to the target URL e.g. clicklid=#{CLICK_ID
}. This is done in the system under Manage Advertisers > Advertiser Tracking
read on
A detailed guide to additional parameters can be found here:
The Shop needs to save the click id / iclid
The shop fetches the click id from the URL and saves it either in a first party cookie or in the data base.When saving it in a cookie, we recommend to set the cookie server side (e.g. with PHP)
Examples
Code example PHP: Cookie with click id server side:
<?php
if (isset($_GET["clickid"])) {
setcookie("clickid", $_GET["clickid"], time() + 365 * 24 * 60 * 60);
}
?>
JavaScript code example: Cookie with click id set in the browser:
<html>
<!-- ... -->
<body>
<div id="mydiv">Hello, this a Test Page</div>
<script>
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires=" + d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function saveClickId(qparam) {
//Get ClickID and save to Cookie
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has(qparam)) {
var cli = urlParams.get(qparam);
setCookie(qparam, cli, 60);
}
}
(function() {
//read new value with name clickid
saveClickId('clickid');
//show value in Browser
var para = document.createElement("P");
var t = document.createTextNode("This is the ID: " + getCookie('clickid'));
para.appendChild(t);
document.getElementById("mydiv").appendChild(para);
})();
</script>
</body>
</hmtl>
Fetching the click id on the confirmation page in order to include it in the conversion tracking tag.
Example code fetch click id from cookie with PHP
<?php
if (isset($_COOKIE["clickid"])) {
$clickid = $_COOKIE["clickid"];
}
?>
Example code to fetch the click id in the browser with JavaScript
<script>
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(";");
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == " ") {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
var clickid = getCookie("clickid");
</script>
Data Structure: Conversion Targets and Tracking Categories
Tracking events are defined by two dimensions: Conversion targets and tracking categories. These dimensions can then be analyzed and remunerated (e.g. a commission per sale).
Conversion targets as well as tracking categories should be registered to the system, before they are transmitted via an implemented conversion tracking tag. Set up is done in the system under Manage Advertisers.
Conversion target: Defines an event and its type, for example Sale, Appinstall, Newslettersignup.
Tracking Category: Defines the commercial dimension, for instance according to the margin of a product group, for example a product group (“Flight”, “Hotel”, “Car Rental”)
read on
A detailed guide on conversion targets and tracking categories can be found here:
Conversion tag
The conversion tracking tag is implemented on the confirmation page after the sales process (or in case of other events on the corresponding pages). This way a completed sale or event will be measured. Data is transmitted with the help of several variables and parameters, for example order id or basket value.
Types of tags
You can either get the conversion tracking tag through the user interface under Trail -> Tracking tags
.
Please implement your individual conversion tracking tag that contains your advertiser id and your tracking domain. Please do not use the PHP/JavaScript code of the following examples as it is.
read on
A detailed guide to generate the conversion tracking tag can be found here:
JavaScript
We generally recommend the use of JavaScript code when implemented browser side.
The JavaScript Code is very suitable for implementation in JavaScript environments such as tag management systems. Another advantage is that the basket parameter (JSON Object) can be easily included. Also it has additional functionalities like a container functionality.
Example:
Image Pixel
For simple tracking events (usually the ones without a basket) the image pixel is well suited. Also, many tracking switches require an image pixel.
Example:
S2S Callback
If you want to transmit the conversion tracking information outside of a browser, e.g. to bypass ad blockers or browser regulation or from the SDK of a mobile app, the S2S callback URL is suitable.
Important: The click id is mandatory, without click id server to server tracking does not work.
The S2S callback link is quite similar to the image pixel. To convert an image pixel to a S2S callback URL just change the parameter typ=i to typ=s .
Example:
read on
A detailed guide on generation of S2S callback URLs can be found here:
Configuring and implementing tracking tags server-to-server (S2S)
Mandatory parameters
Variable (JS) | Variable (img/ s2s) | Example | Description |
|
|
| sale | Conversion Target. The supplied conversion target needs to be registered in the system. |
|
|
| default | Tracking Category. The supplied tracking category should be registered in the system and has to be active. Tracking category 'default' will be used implicitely when none or unknown tracking category is supplied. In case of basket tracking the value “basket” should be used. |
|
|
| ORD12345 | Conversion ID/ Order ID: This parameter identifies the conversion and should be unique. In case the ID contains sensitive information such as an email address, it should be hashed. Max length 255 chars. |
|
|
| 4.98 | Order Value: This parameter transmits the value of the conversion. If the conversion does not contain a value, the transmitted value should be '0.00'. |
|
|
| EUR | Currency Code (ISO 4217) |
|
|
| 1234567890 | Click ids, that were transmitted with the click-in to the website. Usually it is the iclid and as well the gclid, fbclid. |
|
|
| The complete Browser-URL on which the tag was fired. Used to prevent accuracy issues in case of strict referrer browser policy. Please don’t change the default value | URL | Result of |
Optional parameters (frequently used)
Variable (JS) | Variable (img/ s2s) | Explanation | Example |
|
| This parameter transmits any discount values related to the conversion. When a discount is applied, please do not change the order value, the system can deduct the discount value from the order value. | 12.34 |
|
| Code of the used voucher. | XMAS2020-4578aved |
|
| This important parameter transmits any ID given to the customer who placed the conversion. Use this for implementing cross-device and cookieless tracking. Max length 255 chars. | bon78945 |
|
| This important parameter transmits any ID given to the session of the customer who placed the conversion. Use this for implementing cross-device and cookieless tracking. Max length 255 chars. | ses345 |
|
| This parameter registers whether the customer was new to the advertiser. Possible values are true (new) or false (recurring). | true |
|
| Payment method | paypal |
|
| checkout | Sie ID: This parameter identifies the page on which the conversion is made. |
|
| This parameter can transmit additional information. |
|
|
| This parameter can transmit additional information. |
|
|
| This parameter can transmit additional information. |
|
|
| This parameter can transmit additional information. |
|
read on
A detailed guide tracking tag implementation and a list of all parameters can be found here.
Basket tracking
Basket tracking adds basket positions to a conversion. This way all individual products that are part or a conversion can be remunerated and/or analyzed.
Requirement: There needs to be a tracking category (trc) with name and alias “basket” .
The basket parameter contains a string in JSON format. When using an impage pixel or S2S callback URL the basket object needs to be URL-encoded.
The individual components of the basket data are shown in the table below:
Variable | Example | Description |
| 1 | Optional |
| 0d5bb776-2d50-4d65-912c-d20e324f66b8 | Optional |
| 12345678 | The ID of the product to which the basket position relates. |
| Adidas Originals Continental | Name of the product |
| Adidas | Branc |
| 54.95 | Price of the product (gross) |
| 1 | Quantity of bought units |
| default | Tracking category of the product. The tracking category needs to be registered to the system. In case no specific tracking category should be applied, please use “default” |
| Clothing.Men.Shoes | Optional: Hierarchie of the product category. Use ‘.’ as separator. |
Example (without any technical identifier)
No id
/ uuid
is submitted and will be generated internally
[{
"pid": "123456",
"prn": "!Adidas Originals Continental 80",
"brn": "Adidas",
"pri": "54.95",
"qty": "1",
"trc": "default",
"prc": "Mode.Herren.Schuhe.Sneaker"
}, {
"pid": "9876543",
"prn": "Anna Field Damensocken schwarz",
"brn": "Anna Field",
"pri": "12.34",
"qty": "3",
"trc": "default",
"prc": "Mode.Damen.Zubehör"
}]
Example (with optional uuid identifier)
A valid uuid
is submitted and can be used to address this positions
[{
"uuid": "34f40211-98dd-4543-8980-c4b9bcf7416a",
"pid": "123456",
"prn": "!Adidas Originals Continental 80",
"brn": "Adidas",
"pri": "54.95",
"qty": "1",
"trc": "default",
"prc": "Mode.Herren.Schuhe.Sneaker"
}, {
"uuid": "c4f3a903-f9c2-4921-b865-0719c067b3dd",
"pid": "9876543",
"prn": "Anna Field Damensocken schwarz",
"brn": "Anna Field",
"pri": "12.34",
"qty": "3",
"trc": "default",
"prc": "Mode.Damen.Zubehör"
}]
The onpage tag
The onpage tag should be implemented on all publicly accessible pages. Its main purpose is the detection of incoming traffic. Further functionalities are related to traffic quality and a container functionality.
Variable | Example | Description |
| www.shop.com/dresses/red-dress123.html | Path or URL of the Page |
| 12345678 | Only for product pages: Unique product id of the shown product. |
| bon78945 | This important parameter transmits any ID given to the customer. Use this for implementing cross-device and cookieless tracking. Max length 255 chars. |
| ses345 | This important parameter transmits any ID given to the session of the customer. Use this for implementing cross-device and cookieless tracking. Max length 255 chars. |
| Result of | The complete Browser-URL on which the tag was fired. Used to prevent accuracy issues in case of strict referrer browser policy. Please don’t change the default value |
|
| Optional parameter, you are free to put in any additional information that may be needed. |
|
| Optional parameter, you are free to put in any additional information that may be needed. |
Cookies and data protection
When working with tracking technologies, one should (or even is required to) be transparent about it in the privacy policy. Also, an opt-out possibility should be provided.
The following test is a suggestion for a section in the privacy policy of shops working with Ingenious Technologies. Tracking domain as well as external advertiser id (i-number in conversion tracking tag) should be completed:
Tracking quality
Tracking with third party cookies today is significantly restricted, data cannot be recorded properly. Reasons are browser regulation (e.g. Safari, Firefox) or the use of ad blocking software. Third party cookies are all cookies from domains that differ from the shop domain.
We recommend a combination of measures. They can obviously be adapted according to the use case.
Use of a first party tracking domain (for setup, please contact Ingenious Technologies)
Implementation of the click id, that should be saved with the use of server side technologies (PHP)
Implementation of the onpage tag
Use customer id (which can be encrypted or hashed)
Use session id
in case of third party tracking: Execution of the conversion tag server side (S2S callback) to bypass regulated browsers or ad blockers