Each time someone clicks on an affiliate’s tracking URL, that click is logged by our system. Click records hold information like:
- The affiliate whose link was clicked
- The campaign that the link is associated with
- Basic metadata about the client (IP address and user agent)
Every click record has a click ID. This parameter is essential for ensuring reliable tracking.
When a client clicks an affiliate link, they are redirected to your chosen landing page. You can enable passing the client’s click_id in the URL so that when they complete a purchase or another tracked action, this click_id is sent along with the purchase details to your Tracknow dashboard. This allows the system to accurately attribute the purchase to the correct affiliate.
Think of it like a client visiting a store after being recommended by an affiliate. When they walk in, they are wearing a sticker with the affiliate’s name. When the client makes a purchase, the seller checks the sticker to see which affiliate referred them and credits that affiliate accordingly.
How to pass the click_id in the URL
Login to your dashboard and navigate to Campaigns/Offers.
Click the Actions button next to the relevant campaign and select Edit.

Navigate to the Tracking screen.
Add the click_id macro to the Landing Page URL and to Deep Links and click Save.

Now, each time a client clicks an affiliate link, he will be directed to your landing page with his click_id in the URL

Storing the click_id
Once the client lands on your website page with the click_id in the URL, you’ll need to store it in case the client first browses other pages so to prevent the parameter from being lost, store it in a cookie on the clien’t browser.
One option for storing the click_id is to implement a script on all pages of your website. This way, if your landing page changes, tracking will still work without any adjustments.
The cookie should be set to work across all your subdomains, so if a client visits:https://example.com 
the click_id will also be available on:https://checkout.example.com.
You can use this script template:
<script>
// Get a query parameter by name from the URL
function getQueryParam(name) {
  const urlParams = new URLSearchParams(window.location.search);
  const value = urlParams.get(name);
  return value ? value.trim() : null;
}
// Set a cookie for the root domain, available across subdomains
function setCookie(name, value, days) {
  const maxAge = days * 24 * 60 * 60; // days to seconds
  // Derive root domain like example.com
  const hostParts = window.location.hostname.split('.');
  const domain = hostParts.length > 1 ? '.' + hostParts.slice(-2).join('.') : window.location.hostname;
  document.cookie = `${name}=${encodeURIComponent(value)}; path=/; domain=${domain}; max-age=${maxAge}; secure; samesite=Lax`;
}
// Main: look for ref_id and store it
(function () {
  const refId = getQueryParam("ref_id");
  if (refId) {
    setCookie("ref_id", refId, 365); // store for 1 year
  }
})();
</script>
