Skip to main content

Squarespace Integration

Written by David Rolenc
Updated this week

To successfully integrate tracking for your Squarespace store, you should first complete the instructions in the Quick Setup section of your Trackdesk system. Once that is done, follow this guide to configure tracking for both clicks and conversions.


1. Step-by-Step Integration

Step 1: Install the Click Tracking Script

  1. In your Squarespace admin, navigate to Website > Website Tools > Code Injection.

  2. Locate the Header section.
    โ€‹

  3. Paste the following script into the box and save your changes:
    โ€‹

<!-- 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: Install the Conversion Tracking Script

Next, you will add a script to capture successful orders on your confirmation page.

  1. While still in the Code Injection area, scroll down to the Order Confirmation Page section.

  2. Paste the following code into the 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', 'conversion', {
conversionType: 'YOUR_SELECTED_CONVERSION_TYPE',
externalId: "{orderId}",
customParams: {
advS1: "{customerEmailAddress}"
},
amount: {
value: "{orderSubtotal}"
}
});
</script>
<!-- Trackdesk tracker end -->
  • Replace YOUR_TENANT_ID with your actual Tenant ID.

  • Replace YOUR_SELECTED_CONVERSION_TYPE with the specific conversion type you want to use for tracking (e.g., "sale").


2. Customizing the Order Amount

By default, the script uses {orderSubtotal} to track the value of the order. If you wish to use a different variant (for example, a total that includes shipping) you can replace {orderSubtotal} with a different Squarespace variable.

For a full list of available variables, please refer to the Squarespace Documentation on Code Injection.


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

Did this answer your question?