How to integrate with Squarespace

To integrate Affiliatly with Squarespace, you need to add two different codes: one for tracking referred visitors and for tracking purchases made by those referred visitors.


1. Tracking Visits

Copy this code 
<script src="https://static.affiliatly.com/v3/affiliatly.js?affiliatly_code=AF-10XXXX"></script>

Where AF-10XXXX is replaced with your Affiliatly ID, you can find it in the account tab in your Affiliatly dashboard.


Login into your Squarespace panel go to:

Settings -> Advanced -> Code Injection

Find the footer section and paste the code.

By adding this code you are now tracking referred visitors to your site.

To test out the integration you can add ?aff=1 at the end of your store's URL and see if the visit gets tracked on your dashboard.


2. Tracking purchases

To track the purchases made by referred visitors, on the same page Settings -> Advanced -> Code Injection just scroll down and you will find section with the code for the Order tracking.

Copy and paste this code at the order status page of your Squarespace store:
<script>
var affi_id_order = '{orderId}';
var affi_order_price = '{orderGrandTotal}';
var affi_client_email = '{customerEmailAddress}';
var url_affi = "https://static.affiliatly.com/v3/affiliatly.js?affiliatly_code=AF-10XXXXX&conversion=1&id_order="+ encodeURIComponent( affi_id_order ) + "&order_price="+ affi_order_price +"&order_coupons=&client_email=" + affi_client_email;
var script_affi = document.createElement("script");
script_affi.type = "text/javascript";
script_affi.src = url_affi;
document.getElementsByTagName("head")[0].appendChild(script_affi);
</script>

Where AF-10XXXX is replaced with your Affiliatly ID, you can find it in the account tab in your Affiliatly dashboard.


There are few notes about the integration:
  • Due to restrictions with SquareSpace, the variable {orderGrandTotal} is taking into account discounts to your products, but it is including the shipping value. You can use {orderSubtotal} instead, but that variable is not taking discounts to your products into account while it is excluding shipping value.
  • We are not able to track appointments made via the Acuity plugin for Squarespace.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us