Conversions can be created via a POST request. In order to do so, please follow the instructions below.
When a visitor enters the landing page, you will need to have our click tracking script present on the page so we can generate the CID of a click. You will then need to take this generated CID and save it for the user. The CID is saved to a cookie named trakdesk_cid. With this CID, you are able to create a conversion when it occurs.
Format of the POST Request
URL to send the request to: https://YOUR_TENANT_ID.trackdesk.com/tracking/conversion/v1
Instead of YOUR_TENANT_ID, use your actual tenant ID.
The body of the request should be:
{
"cid": "OUR_CID",
"conversionTypeCode": "SELECTED_CONVERSION_TYPE"
}
Make sure to replace "OUR_CID" with the CID you saved previously.
Make sure to replace "SELECTED_CONVERSION_TYPE" with the conversion type for which you want to create the conversion (this will depend on how you set up the offer).
Revenue Share
To use revenue share, you also need to provide the amount of revenue when creating the conversion.
Here is the body content for this case:
{
"cid": "OUR_CID",
"conversionTypeCode": "SELECTED_CONVERSION_TYPE",
"amount": {
"value": "CONVERSION_AMOUNT"
}
}
Make sure to replace "CONVERSION_AMOUNT" with the amount you want to prorate to the system.
Make sure to replace "SELECTED_CONVERSION_TYPE" and "OUR_CID" as described in the above variants.
The amount is used to calculate the final payouts of the affiliate depending on what % values you have for the offer.
Conversions with an External CID
To create a conversion with an External CID you will first need to set the External CID. This is done either via script Set external CID or via a POST request to set the External CID.
By Script: Add the Set external CID script to the page where a visitor has our tracking cookie saved, and you will be able to provide us with a unique identification (External CID), for example, an ID from your database or email of the visitor.
<!-- 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_EXT_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID"
});
</script>
<!-- Trackdesk tracker end -->
Make sure to replace YOUR_TENANT_ID with your actual tenant ID, which can be found on the settings main page.
Make sure to replace YOUR_EXT_CID with the External ID you want to save.
Make sure to replace YOUR_REVENUE_ORIGIN_ID with your Revenue Origin ID, which can be found on the settings main page.
Or via POST request
To URL https://YOUR_TENANT_ID.trackdesk.com/tracking/external-cid/v1
Instead of YOUR_TENANT_ID, use your actual tenant ID.With request body:
{
"externalCid": "YOUR_EXT_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID",
"cid": "OUR_CID"
}
Make sure to replace YOUR_EXT_CID with the External ID you want to save.
Make sure to replace YOUR_REVENUE_ORIGIN_ID with your Revenue origin ID, which can be found on the settings main page.
Make sure to replace "OUR_CID" with the CID you saved previously.
You then can continue to create the conversion with External CID
If you wish to create a conversion with an External CID via a POST request, the body of the request should be sent to the same URL as in the examples above for conversions with CID.
{
"externalCid": "YOUR_EXTERNAL_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID"
"conversionTypeCode": "SELECTED_CONVERSION_TYPE"
}
Make sure to replace "YOUR_EXTERNAL_CID" with the external ID for the conversion it is created for.
Make sure to replace "YOUR_REVENUE_ORIGIN_ID" with your Revenue origin ID, which ID can be found in your Trackdesk platform in offer tracking in setup for recurring commissions.
Make sure to replace "SELECTED_CONVERSION_TYPE" as described in the above variants.
And likewise for variant of revenue share with External CID:
{
"externalCid": "YOUR_EXTERNAL_CID",
"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID"
"conversionTypeCode": "SELECTED_CONVERSION_TYPE",
"amount": {
"value": "CONVERSION_AMOUNT"
}
}
Make sure to replace the variables as described in the above.