Skip to main content

Wix Integration with Stripe

Written by Zuzana Toulcová
Updated over 2 weeks ago

This guide explains how to integrate your Wix store with Stripe 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.


1. Before You Start

Ensure you have the following identifiers and access ready:

  • Your Tenant 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.




2. Step-by-Step Instructions

Step 1: Install and Configure the Trackdesk Stripe App

The Stripe app bridges the data between your payments and Trackdesk.

  1. Go to the Stripe Marketplace and install the Trackdesk app.

  2. Open the app settings within your Stripe dashboard.

  3. Enter your Tenant ID and Personal Token in the required fields.

  4. Click Save changes.

Step 2: Set Up Click Tracking in Wix

You must add the click tracking script to every page of your website to capture incoming affiliate traffic.

  1. Add a new Custom Code in Wix

  2. Paste the following script into the code box:

    <!-- 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 -->

  3. Replace YOUR_TENANT_ID with your actual Trackdesk Tenant ID.

  4. Configure Settings:

    • Name: Trackdesk Click Tracking

    • Add Code to Pages: All Pages

    • Place Code in: Head

  5. Click Apply.


Step 3: Set Up the Conversion Connection Script

his script links the customer's email to the affiliate click right before they proceed to checkout. It should be placed on the page where your "Buy" or "Checkout" button is located.

  1. Add a new Custom Code in Wix

  2. Paste the following "Help Script":

    <!-- Trackdesk help script wix stripe connection 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");

    (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("YOUR_TENANT_ID", "externalCid", {
    externalCId: input.value,
    revenueOriginId: "YOUR_REVENUE_ORIGIN_ID",
    });
    }
    })
    } catch (e) {
    console.error(e)
    }
    })
    })
    }())
    </script>
    <!-- Trackdesk help script wix stripe connection end -->

  3. Replace YOUR_TENANT_ID and YOUR_REVENUE_ORIGIN_ID with your actual identifiers.

  4. Configure Settings:

    • Name: Trackdesk Conversion

    • Add Code to Pages: Specific Pages (Select your Checkout / Payment page)

    • Place Code in: Body - End

  5. Click Apply.


3. 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.

Did this answer your question?