This guide is designed for websites that use PayPal as their sole payment provider for non-recurring payments. To successfully track your PayPal activity, you'll need to configure settings both in Trackdesk and within your PayPal account.
Step-by-step integration
Step 1: Add the click script
To track visitor clicks, add the click tracking code to every page of your website, including all landing pages. Place it as high as possible in the <head>, ideally right after the opening <head> tag, so the click is recorded before the visitor can leave the page.
<!-- Trackdesk tracker begin -->
<script async src="//TENANT_ID.trackdesk.com/main.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("TENANT_ID", "click");
</script>
<!-- Trackdesk tracker end -->
Replace TENANT_ID with your Tenant ID.
Step 2: Add the conversion script
Next, paste the following code onto your thank-you page (the page users see immediately after a successful payment) to record conversions. Place it right before the closing </body> tag, so any order details shown on the page are already loaded if you later extend the script to read them.
<!-- Trackdesk tracker begin -->
<script async src="//TENANT_ID.trackdesk.com/main.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("TENANT_ID", "conversion", {
conversionType: "CONVERSION_TYPE",
externalId: { queryParam: "tx" },
amount: {
value: { queryParam: "amt" }
}
});
</script>
<!-- Trackdesk tracker end -->
Replace these values:
TENANT_ID: your Tenant IDCONVERSION_TYPE: the code of the Conversion Type you want to use for tracking, for examplesale
Step 3: Update your PayPal settings
Log in to your PayPal account.
Navigate to Settings (gear icon) → Account Settings.
Go to the Website Payments section.
Find Website Preferences and click Update.
Set Auto return to On and enter your thank-you page URL.
Set Payment Data Transfer (PDT) to On.
Testing your integration
Before officially launching your affiliate program, it's important to verify that clicks and conversions are being tracked correctly.
You can perform a test by following the steps in our guide: Testing an Offer. This ensures that every part of the integration is communicating perfectly with Trackdesk.
