You can create conversions in Trackdesk manually by sending a POST request. This is useful for custom integrations where standard tracking scripts might not capture every event.
1. Prerequisites: Capturing the CID
To create a conversion, you first need a Click ID (CID).
When a visitor lands on your page, the Trackdesk click tracking script must be present to generate this ID.
The script automatically saves the CID in a browser cookie named
trakdesk_cid.You must retrieve and store this CID (e.g., in your database or session) to use it later in your POST request.
2. Conversions via Click ID
Use these formats when you are tracking conversions using the standard Trackdesk Click ID.
Scenario A: Fixed Amount
Use this for offers with a pre-defined, fixed payout.
Endpoint URL:
https://YOUR_TENANT_ID.trackdesk.com/tracking/conversion/v1
Request Body:
{
"cid": "OUR_CID",
"conversionTypeCode": "SELECTED_CONVERSION_TYPE"
}
YOUR_TENANT_ID: Replace it with your actual Trackdesk Tenant ID.
OUR_CID: The Click ID you saved from the visitor's cookie.
SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").
Scenario B: Revenue Share (Dynamic Amount)
If your offer pays a percentage of the sale, you must include the conversion amount so the system can calculate the correct payout.
Endpoint URL:
https://YOUR_TENANT_ID.trackdesk.com/tracking/conversion/v1
Request Body:
{
"cid": "OUR_CID",
"conversionTypeCode": "SELECTED_CONVERSION_TYPE",
"amount": {
"value": "CONVERSION_AMOUNT"
}
}
OUR_CID: The Click ID you previously saved.
SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").
CONVERSION_AMOUNT: must be a string. Use"100"for whole numbers or"100.50"for decimals.
3. Conversions via External CID
If you prefer to identify users by your own internal IDs (like a database ID or email address), you can use an External CID. This is a two-step process.
Step A: Set the External CID
Before you can track a conversion using your own ID, you must first link the Trackdesk CID to your External CID. You can do this via script or POST request:
Option 1: Via Script
Place this code on the page where the visitor has their tracking cookie saved:
<!-- Trackdesk tracker begin -->
<script async src="//cdn.trackdesk.com/tracking.js"></script>
<script>
(function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");
trackdesk("YOUR_TENANT_ID", "externalCid", {
"externalCid": "YOUR_EXTERNAL_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID"
});
</script>
<!-- Trackdesk tracker end -->
YOUR_TENANT_ID: Replace it with your actual Trackdesk Tenant ID.
YOUR_EXTERNAL_CID: Replace it with the External ID you want to save.
YOUR_REVENUE_ORIGIN_ID: Replace it with your Revenue Origin ID.
Option 2: Via POST Request
Endpoint URL::
https://YOUR_TENANT_ID.trackdesk.com/tracking/external-cid/v1
Request Body:
{
"externalCid": "YOUR_EXTERNAL_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID",
"cid": "OUR_CID"
}
YOUR_EXTERNAL_CID: Replace it with the External ID you want to save.
YOUR_REVENUE_ORIGIN_ID: Replace it with your Revenue Origin ID.
OUR_CID: The Click ID you previously saved.
Step B: Create the Conversion
Once linked, send your conversion via a POST request using the externalCid instead of the standard cid.
Scenario A: Fixed Amount
Endpoint URL::
https://YOUR_TENANT_ID.trackdesk.com/tracking/external-cid/v1
Request Body:
{
"externalCid": "YOUR_EXTERNAL_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID"
"conversionTypeCode": "SELECTED_CONVERSION_TYPE"
}
YOUR_EXTERNAL_CID: Replace it with the External ID you want to save.
YOUR_REVENUE_ORIGIN_ID: Replace it with your Revenue Origin ID.
SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").
Scenario B: Revenue Share (Dynamic Amount)
Endpoint URL::
https://YOUR_TENANT_ID.trackdesk.com/tracking/external-cid/v1
Request Body:
{
"externalCid": "YOUR_EXTERNAL_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID"
"conversionTypeCode": "SELECTED_CONVERSION_TYPE",
"amount": {
"value": "CONVERSION_AMOUNT"
}
}
YOUR_EXT_CID: Replace it with the External ID you want to save.
YOUR_REVENUE_ORIGIN_ID: Replace it with your Revenue Origin ID.
SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").
CONVERSION_AMOUNT: must be a string. Use"100"for whole numbers or"100.50"for decimals.
