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.
1. Step-by-Step Integration
Step 1: Add the Click Script
To track visitor clicks, you must place the click tracking code on every page of your website. For the best results, insert it into the <head> tag, as high as possible.
<!-- 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', 'click');
</script>
<!-- Trackdesk tracker end -->
Replace YOUR_TENANT_ID with your actual 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.
<!-- 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', 'conversion', {
conversionType: 'YOUR_SELECTED_CONVERSION_TYPE',
externalId: { queryParam: "tx" },
amount: {
value: { queryParam: "amt" }
}
});
</script>
<!-- Trackdesk tracker end -->
Replace
YOUR_TENANT_IDwith your actual Tenant ID.Replace
YOUR_SELECTED_CONVERSION_TYPEwith the specific conversion type you want to use for tracking (e.g., "sale").
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.
2. 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.
