Skip to main content

Redirect tracking

Written by David Rolenc
Updated over 2 weeks ago

Before proceeding with this integration, ensure you have your redirect landing page properly set up in your offers. You can find more details about setting them up in this article.

⚠️ Important: The following guidelines apply only to offers using redirect landing pages.

When using redirect tracking, a Click ID (CID) is generated and appended to the visitor's URL as soon as they land on the page.


Step 1: Save the CID from the Redirect URL

Your first step is to capture and save the CID parameter from the URL on your end (for example, in your database, local storage, or as a cookie). You will need this parameter for the subsequent steps to record conversions.

We will refer to this parameter as OUR_CID going forward.

Connecting to an External Advertiser:

If you are working with an external advertiser, they might already have their own affiliate tracking solution. In this case, simply agree with the advertiser on which query parameter you should use to pass the CID to them. These parameters are typically called sub parameters, aff parameters, or source parameters.


Step 2: Create a Conversion

To record a conversion for redirect tracking, you can use either a GET or POST postback method.

Option A: GET Postback

Fixed Amount Offers:

To send a GET postback for an offer with a fixed commission amount, use this URL structure:

https://YOUR_TENANT_ID.trackdesk.com/tracking/conversion/v1?conversionTypeCode=SELECTED_CONVERSION_TYPE&cid=OUR_CID

  • YOUR_TENANT_ID: Replace it with your actual Trackdesk Tenant ID.

  • SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").

  • OUR_CID: The Trackdesk Click ID.


Revenue Share Offers:

To use revenue share for an offer with a dynamic payout, you must provide the specific revenue amount when creating the conversion. The system uses this value to calculate the respective commissions for both the network and the affiliate.

https://YOUR_TENANT_ID.trackdesk.com/tracking/conversion/v1?conversionTypeCode=SELECTED_CONVERSION_TYPE&cid=OUR_CID&amount.value=AMOUNT_PLACEHOLDER

  • YOUR_TENANT_ID: Replace it with your actual Trackdesk Tenant ID.

  • SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").

  • OUR_CID: The Trackdesk Click ID.

  • AMOUNT_PLACEHOLDER: Replace it with the specific amount you wish to prorate. The system will use this value to calculate both network and affiliate commissions. This value must be a string (e.g., "100" for whole numbers or "100.50" for decimals).

Option B: POST Postback

Fixed Amount Offers:

To send a POST postback for an offer with a fixed amount, use the following postback to create a conversion:

Endpoint URL:

https://YOUR_TENANT_ID.trackdesk.com/tracking/conversion/v1

Payload:

{

"conversionTypeCode": "SELECTED_CONVERSION_TYPE",

"cid": "OUR_CID"

}

  • YOUR_TENANT_ID: Replace it with your actual Trackdesk Tenant ID.

  • SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").

  • OUR_CID: The Trackdesk Click ID.


Revenue share:

To use revenue share for an offer with a dynamic payout, you must provide the specific revenue amount when creating the conversion. The system uses this value to calculate the respective commissions for both the network and the affiliate.

Endpoint URL:

https://YOUR_TENANT_ID.trackdesk.com/tracking/conversion/v1

Payload:

{

"conversionTypeCode": "SELECTED_CONVERSION_TYPE",

"cid": "OUR_CID",

"amount": {

"value": "AMOUNT_PLACEHOLDER"

}

}

  • YOUR_TENANT_ID: Replace it with your actual Trackdesk Tenant ID.

  • SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale" or "signup").

  • OUR_CID: The Trackdesk Click ID.

  • AMOUNT_PLACEHOLDER: Replace it with the specific amount you wish to prorate. The system will use this value to calculate both network and affiliate commissions. This value must be a string (e.g., "100" for whole numbers or "100.50" for decimals).


Step 3: Add Extra Parameters (Optional)

You can attach up to 9 extra parameters to your conversion for more detailed tracking. (Tip: Use the builder tool in our API documentation to help generate your customized postback link).

Adv S1–Adv S5

There are five parameters available for general use. Use the following format to add them to your postback (see the example for the Adv S1 parameter below):

GET format

customParams.advS1=VALUE

POST format

"customParams": {
"advS1": "VALUE"
}


Customer ID

General parameter for any information. Use the following format to add this parameter to the postback

GET format

customerId=VALUE

POST format

"customerId": "VALUE"

External ID

Parameter used for deduplication. This parameter can be present only once on the platform, generally an Order ID or other internal ID uniquely identify transaction is used.

GET format

externalId=VALUE

POST format

"externalId": "VALUE"



Currency

Parameter used to specify the currency for the conversion. This parameter can be used only for cases with revenue share.

GET format

externalId=VALUE

POST format

"externalId": "VALUE"

Status

Parameter used to specify the conversion status that the conversion will be created with.

GET format

status=VALUE

POST format

"status": "VALUE"


Step 4: Refund Handling (Optional)

Refunds can be handled automatically via an API request. This is initiated by a webhook on your side that triggers when an order's status changes to "refunded".

To make this work, you must include the External ID when creating the initial conversion (as shown in Step 2). This unique identifier is required to track and update the status of specific records.

When the refund webhook is triggered, it must include the Order ID or Charge ID that matches the External ID saved on the original conversion. This ensures the records are correctly paired for the update.

If you prefer not to automate this part, it can be safely skipped. However, keep in mind that if a commission is attributed and later refunded, you will ideally want to reverse the affiliate commission.

Endpoint URL:

https://YOUR_TENANT_ID.trackdesk.com/api/node/conversions/v1/update-status-by-external-id

Request Payload:

{

"revenueOriginId": "YOUR_REVENUE_ORIGIN_ID",

"externalId": "REPLACE_WITH_CHARGE_ID_OR_ORDER_ID",

"conversionTypeCode": "SELECTED_CONVERSION_TYPE",

"status": "CONVERSION_STATUS_REFUNDED"

}

  • YOUR_TENANT_ID: Replace it with your actual Trackdesk Tenant ID.

  • YOUR_REVENUE_ORIGIN_ID: Replace it with your Revenue Origin ID.

  • REPLACE_WITH_CHARGE_ID_OR_ORDER_ID: should be replaced with the charge ID of the refunded payment.

  • SELECTED_CONVERSION_TYPE: The code for the conversion event (e.g., "sale").

Did this answer your question?