Conversions: tracking methods
RedTrack offers you the following methods of conversion tracking:
- API
- S2S
- Pixel/script
API
API conversion tracking method is based on the integration of the RedTrack API with the affiliate network. This is the most reliable conversion tracking method because it happens on the backend of both platforms. When a conversion occurs, the affiliate network infrastructure pings RedTrack with all the necessary information. However, since this method requires a lot more development work on both sides, it is not very common in affiliate marketing and not all the systems support it.
API method in a nutshell:
- It’s the most reliable method of passing the conversion. It does not need cookies to work.
- It’s a “set it and forget it” method. Once you complete the integration, you won’t need to configure anything. Conversions will be shared along with additional information such as payout.
- Can be challenging to implement.
These are the API-integrated offer sources/websites:
S2S
Server-to-server (S2S) postback is a very accurate method of receiving and sending conversion data. S2S tracking saves the information about the user ID directly to the server of an advertiser (offer provider), RedTrack, and Affiliate Network. When a user clicks on an ad, this click is recorded and gets a newly generated unique ID for this session. If a user buys or orders something on the offer provider’s side, RedTrack receives a message from the offer provider (affiliate network, advertiser) about the conversion that happened. This is a standard option available for everyone. No additional settings are required.
- It provides slightly accurate tracking and accurate statistics. This tracking method does not rely on cookies. Therefore, it works even if the visitor has blocked the collection of cookie data in their web browser. That is why it is considered one of the most reliable tracking methods
- Postback tracking must be supported by your affiliate network
How to set the correct S2S postback in RedTrack depends on the network you are using:
Your affiliate network has a preset template
1. Add the Offer source template to RedTrack→ Save it:
2. Copy the Postback URL from the settings:
3. Paste the copied Postback URL to your affiliate network account under the postback settings
Your affiliate network has no preset template
1. Offer sources -> new from scratch:
2. Give your custom Offer source a name, and clarify the correct CLICKID and SUM macros essential for tracking. Once you’ve added them, press Save:
3. Copy the generated Postback URL:
4. Paste it to your affiliate network/advertiser account under the postback settings
Pixel/script
Conversion tracking using Pixel is the simplest and least accurate method. You place a piece of code (or script) on your “Thank you” page and each time the visitor opens this page, the conversion is fired with the help of the script. That means the same visitor can refresh the page and the pixel will then be fired once again so you may receive a duplicate.
- You can use it if the S2S option is not available
- It’s the ultimate solution when you don’t have many technical resources and have your own “thank you page”
- Pixel is simple and fast to implement and use, so there is no need to be a technical expert. You simply copy the pixel from the tracker and paste it into the code of the last page that the user sees after the conversion has occurred.
- Sometimes pixels may not work. One reason for this could be the user clearing the cache between clicking a link on the landing page and the actual conversion. In this case, the conversion will simply not be tracked
- Apple has implemented Smart Tracking Protection 2.0 in Safari, preventing websites from tracking user activity without permission. Right now, the website can request tracking permission, but the user must specifically register. Even if the user consents to be tracked by Safari on their own, after 30 days all data and cookies will be permanently deleted. In general, pixel tracking is a fairly complex process when working with Safari
- Google has announced that its Chrome web browser will no longer support third-party cookies from 2022, which will, of course cause pixel tracking issues and make a simple pixel/script a solution only for the redirect tracking
The script has to be added at the end of the body section. Otherwise, it might fail to trigger correctly.
A simple solution for a third-party cookie (redirect)
1. Tools→ Conversion Tracking→ stay on the tab Conversion Tracking:
2. RedTrack generates a unique pixel with your dedicated tracking domain but you can change it to a custom tracking domain. To change the domain press on the Domain field in the Conversion postback domain section and choose the needed domain from the dropdown list of the added ones:
3. Activate the toggle Show pixel for statuses (Pending, Approved, Declined, Other) to use statuses to track changes in the conversion status in COD and similar scenarios:
4. Copy any of the available options: Pixel postback code for conversion (in the Conversion tracking pixel section) or Postback script (preferred option in the Postback script section):
<img src=”//domain.rdtk.io/postback?format=img&sum={replace}&type=Purchase” width=”1″ height=”1″ />
5. Paste the copied ready-to-use pixel to your Thank You page to track visitors’ activity.
Upgraded script for a first-party cookie
1. Use the Universal Tracking Script to capture the click data.
It captures the tracking parameters, sends them back to RedTrack, generates the clickid and saves it in the first-party cookie rtkclickid-store
2. Adjust the script below.
It reads the first-party cookie and adds it to the postback URL. Modify the postback URL and the first-party cookie name→ replace “https://example.com/your-endpoint” with the actual URL where you want to send the request:
// Function to read a cookie by its name
function getCookie(cookieName) {
var name = cookieName + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var cookieArray = decodedCookie.split(';');
for (var i = 0; i < cookieArray.length; i++) {
var cookie = cookieArray[i];
while (cookie.charAt(0) == ' ') {
cookie = cookie.substring(1);
}
if (cookie.indexOf(name) == 0) {
return cookie.substring(name.length, cookie.length);
}
}
return "";
}
// Get the value of the "rt-cookie" cookie
var rtCookieValue = getCookie("rt-cookie");
// Construct the URL with the cookie value appended
var baseUrl = "https://example.com/your-endpoint"; // Replace with your actual URL
var urlWithCookie = baseUrl + "?rt_cookie_value=" + encodeURIComponent(rtCookieValue);
// Make a request to the URL
fetch(urlWithCookie)
.then(response => {
if (response.ok) {
// Handle the response if needed
return response.text();
} else {
throw new Error("Request failed with status: " + response.status);
}
})
.then(data => {
// Process the response data here
console.log("Response data: " + data);
})
.catch(error => {
// Handle any errors that occurred during the fetch
console.error("Fetch error: " + error);
});
The cookie value is then appended to the base URL to create the final URL with the query parameter rt_cookie_value.
The fetch API is used to make a GET request to the URL, and you can handle the response and any errors as needed.
Received conversions in reports
Campaigns table→ table settings→ choose all the custom conversion types you are using→ save the columns:
For more information go to Reports.