Our first party tracking relies on a HTML file that has to be place on the Advertiser’s server and a script that has to be placed on the order confirmation page (also known as “thank you page”). The HTML file will set the 1st party cookie with our tracking ID tmt_data
and redirect the user to the target URL on the Advertiser’s website. This file is where all tracking links will point to. The script on the confirmation page reads the cookie and passes the tracking ID back to our tracking server.
Placing the HTML file
The HTML file can be downloaded here or created from the source code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="https://cdn.trackmytarget.com/tracking/s/entrypoint.min.js"></script>
</body>
</html>
The HTML file can be renamed to anything you like and placed anywhere on your server. The URL pointing to the file should be added in the tracking tab of the Offer creator:
It is important that the URL that is set up in the Offer creator always corresponds with the actual location of the file, otherwise tracking will not work. Therefore we do not recommend changing the name or location of the file after the initial set up.
Implementing the script
The script has to be placed on the order confirmation page(s) of your website. It should be placed as high on the confirmation page as possible to ensure it loads successfully. We suggest placing it right after the <body>
opening tag.
You can grab the script for the type of transaction you want to track here:
Lead script:
<script src="https://cdn.trackmytarget.com/tracking/s/checkout.min.js" data-type="lead" data-offer-sid="{offer_sid}" data-event-sid="{event_sid}" data-id="{id}"></script>
<noscript>
<img src="https://p.trackmytarget.com/?type=lead&offer_sid={offer_sid}&event_sid={event_sid}&id={id}" alt="" width="1" height="1" border="0" />
</noscript>
Sale script:
<script src="https://cdn.trackmytarget.com/tracking/s/checkout.min.js" data-type="sale" data-offer-sid="{offer_sid}" data-event-sid="{event_sid}" data-id="{id}" data-amount="{amount}" data-currency="{currency}" data-code="{code}"></script>
<noscript>
<img src="https://p.trackmytarget.com/?type=sale&offer_sid={offer_sid}&event_sid={event_sid}&id={id}&amount={amount}¤cy={currency}&code={code}" alt="" width="1" height="1" border="0" />
</noscript>
Before placing the script on the confirmation page(s), you should replace all the parameter values in the curly brackets {}
.
Parameters
-
{offer_sid}
required
Replace with 6 character sID of the Offer. You can find this value in Offer list of the marketplace or ask your account manager. -
{event_sid}
required
Replace with the 6 character sID of the product group. You can find this value in the tracking tab when creating or editing an Offer or you can ask your account manager. If you want work with multiple product groups, follow these instructions. -
{id}
Replace with the ID you assign to the transactions in your own system. Required if you set up the Offer to require unique transaction IDs -
{amount}
Replace with the transaction amount. Do not use any thousand delimiter and use.
as decimal delimiter (e.g.1234.56
). Required if you want to payout a percentage of the transaction amount to your Publishers. -
{currency}
Replace with the three letter alphabetic currency code according to the ISO 4217 standard (e.g. EUR ). Required if you are using the amount parameter. -
{code}
Replace with the voucher code used for the order. Accepts all alphanumeric characters, hyphens (-) and underscores (_). Required if you are using voucher code tracking.
Disable setting a cookie for some users
The HTML file loads a Javascript that is hosted on our servers. This script allows to disable the placement of the 1st party cookie on a per-user bases. This can be useful when local legislation requires you to get consent from the end-user to place a cookie. In those cases the script tag should be integrated on the page you use to ask for consent. If the end-user gives consent the script should be loaded as usual. If the user doesn’t give consent, the argument data-cookie="false"
should be added on the <script...>
tag to prevent the placement of a cookie. An example of how the complete script tag looks is added below:
<script src="https://cdn.trackmytarget.com/tracking/s/entrypoint.min.js" data-cookie="false"></script>
Important note: if you disable the placement of a 1st party cookie our tracking will rely only on fingerprinting which might affect the accuracy.