To track events on your custom-built website and view the data in your Tracknow dashboard, an integration is required.
This integration allows your website to send relevant event data directly to Tracknow, enabling accurate tracking and reporting.
Flow overview
Each affiliate in your campaign receives a unique tracking link, referred to as the affiliate link. This link is automatically generated by Tracknow once the affiliate joins your campaign and is displayed on their campaign page.
Affiliates use this link to promote your website or service by directing potential clients to your designated landing page.
When someone clicks an affiliate link, Tracknow logs the click and assigns it a unique identifier called a click_id. This click_id serves as the connection between the client who clicked the link and the affiliate who referred them.
It is necessary to pass this parameter to the website’s landing page as it later needs to be returned back to Tracknow along with the other purchase detials to ensure proper affilaite attribution. This can be done by appending it to the landing page URL in your Tracknow campaign settings.
How to append the click_id parameter to the landing page URL?
- Navigate to the ‘Campaigns/Offers’ page
- Click the campaign’s ‘Actions’ icon and select ‘Edit’
- Navigate to the ‘Tracking’ tab
- Add the click_id parameter to landing page URL and for deep links as well
- Save the changes


This will allow you to pass the click_id parameter to the landing page of the website being promoted.
For example, if your website’s landing page looks like this:
https://example.com
When an affiliate link is clicked it will redirect to a link that looks like this:
https://example.com/?click_id=27d65ddb-803f-4f59-88b3-753c8059dcba
Storing the click_id parameter
Once the client is redirected to your website with the click_id parameter appended to the URL, this parameter needs to be stored. You need to add a script to all pages of your website (for example in the footer of the website) that will look for this parameter in the browser’s address bar and save it in the client’s browser cookie for later access.
Why should it be added to all pages of the website?
Adding the tracking script to every page means you won’t have to update the integration later even if landing page changes. It ensures everything keeps working without needing any extra setup in the future.
Cookie availability
The cookie must be linked to your main domain (e.g., example.com) so it’s also accessible on subdomains like shop.example.com or checkout.example.com
Example script
Feel free to use our script template:
<script>
// Get a query parameter by name from the URL
function getQueryParam(name) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);
}
// Set a cookie for the root domain, available across subdomains
function setCookie(name, value, days) {
const maxAge = days * 24 * 60 * 60; // days to seconds
const domain = "." + window.location.hostname.split('.').slice(-2).join('.'); // example.com
document.cookie = `${name}=${encodeURIComponent(value)}; path=/; domain=${domain}; max-age=${maxAge}; secure; samesite=Lax`;
}
// Main: look for click_id and store it
(function () {
const clickId = getQueryParam("click_id");
if (clickId) {
setCookie("click_id", clickId, 365); // store for 1 year
}
})();
</script>
Passing event data
When a client is referred to your website and completes a purchase, we need to receive the purchase details to track the conversion. This can be achieved by triggering a postback URL that sends the data to your Tracknow dashboard.
What is a postback URL?
A postback URL is a specially formatted link used to send transaction data from your website to our system after a user completes a purchase.
It works as a server-to-server (S2S) tracking method, meaning your server triggers the link once the purchase or event is confirmed.
When should the postback URL be triggered?
The postback URL should be triggered only when a client completes a purchase.
How is a postback URL structured?
A postback URL has two parts: the base URL, which is the link that receives the data, and the parameters, which include the actual transaction details. The parameters are appended to the base URL to form the complete postback URL.
What is the base URL?
The base URL can be found within your campaign:
- Click on the relevant campaign from your campaign list
- Navigate to the campaign’s ‘Setup/Integration’ page
- Select the ‘Postback’ tab
- Copy the base URL (highlighted part as shown in the screenshot below)


The base URL is the part of the link up until the parameters, it should look similar to this:
https://exmaple-tracking.tracknow.info/postback?
What are the parameters?
Parameters are the specific values you send with the event, providing details you want to appear in your Tracknow dashboard.
You can find the full list of parameters that can be passed here.
The only mandatory parameters are those required by Tracknow to ensure accurate tracking, attribution, and commission calculation. These include:
click_id, campaign_id, and amount.
Without these, the system cannot properly attribute events or calculate payouts. You can choose to pass any other parameter according to your tracking needs.
Make sure that you URL-encode all parameter values.
Postback format
As mentioned above, the final postback URL that should be triggered is constructed from a base URL and parameters & values. Each parameter has a KEY and VALUE and the format of the final postback URL should be as follows:
https://exmaple-tracking.tracknow.info/postback?click_id={value}&campaign_id={value}&order_id={value}&amount={value}&first_name={value}&email={value}
The actual purchase details should replace the {value}
placeholders next to each parameter key. Once populated with real data, the final postback URL should look like this:
https://exmaple-tracking.tracknow.info/postback?click_id=a520dca8-ab08-4640-af65-034be3a68909&campaign_id=1&order_id=23315&amount=150&first_name=John&email=john.example%40gmail.com
Summary
The steps needed to complete this integration can be broken down to the following main objectives:
- Implement a script on all pages of your website to look for a click_id parameter appended to the client’s landing page URL and store it in a cookie on client’s browser
- Add logic that checks if a purchase was completed
- If a purchase was completed, load all the necessary parameter value, URL-encode them and assign them to their dedicated parameter KEY
- Append the parameters to the base URL to create the final postback URL and trigger it to send the data
