This guide explains how to integrate your Wix store and Stripe with Trackdesk to track affiliate clicks and conversions. This method is specifically designed for setups where customers register or fill out a form before proceeding to payment, and where Stripe Payment Links are not being used.
⚠️ Important:
Compatibility: This method does not support Stripe Payment Links. If you use payment links (URLs containing
buy.stripe.com), please refer to the Stripe via Payment Links guide.
Before you start
Ensure you have the following identifiers and access ready:
Your Tenant ID.
Your Personal Token.
Your Revenue Origin ID.
Wix admin access: So you can add custom code snippets to your site. For this, navigate to Settings → Custom Code and click + Add Custom Code at the top right (as shown in the screenshots below). You can also refer to this guide on the Wix Support site, which explains how to add custom code in more detail.
Step-by-step instructions
Step 1: Install and configure the Trackdesk Stripe app
The Stripe app bridges the data between your payments and Trackdesk.
Go to the Stripe Marketplace and install the Trackdesk app.
Open the app settings within your Stripe dashboard.
Enter your Tenant ID and Personal Token in the required fields.
Click Save changes.
Step 2: Set up click tracking in Wix
Add the click tracking script to every page of your website, including all landing pages, in the page head, so the click is recorded before the visitor can leave the page.
Add a new Custom Code in Wix.
Paste the following script into the code box:
<!-- 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 both occurrences of
TENANT_IDwith your Tenant ID.Configure settings:
Name:
Trackdesk Click TrackingAdd Code to Pages: All Pages
Place Code in: Head
Click Apply.
Step 3: Connect the customer email to the click
This script links the customer's email to the affiliate click right before they proceed to checkout. It should be placed at the end of the page body (Body - End) on the page where your Buy or Checkout button is located, so the button it listens to already exists.
Add a new Custom Code in Wix.
Paste the following help script:
<!-- Trackdesk help script wix stripe connection 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");
(function(){
document.querySelectorAll("[data-hook='payment-checkout-buy-now']").forEach(function(paymentCheckoutBuyNow) {
paymentCheckoutBuyNow.addEventListener("click", function() {
try {
document.querySelectorAll("[data-hook='cashier-payments-method-field-textField-email']").forEach(function(input) {
if(/\S+@\S+\.\S+/.test(input.value)) {
trackdesk("TENANT_ID", "externalCid", {
externalCid: input.value,
revenueOriginId: "REVENUE_ORIGIN_ID"
});
}
})
} catch (e) {
console.error(e)
}
})
})
}())
</script>
<!-- Trackdesk help script wix stripe connection end -->Replace these values:
TENANT_ID: your Tenant ID (both occurrences)REVENUE_ORIGIN_ID: your Revenue Origin ID
Configure settings:
Name:
Trackdesk Email ConnectionAdd Code to Pages: Specific Pages (select the page with your Buy or Checkout button)
Place Code in: Body - End
Click Apply.
Testing your integration
It's important to verify your setup before launching your affiliate program.
Create a test click: Use an affiliate link to visit your site and ensure the click is registered in the Clicks report.
Perform a test purchase: Complete a transaction using a test email to verify that the conversion is successfully linked to the click and registered in the Conversions report.
For detailed testing instructions, please refer to our Testing an Offer guide.



