Squarespace has its own built-in cookie banner that asks your visitors whether they accept cookies.
Converly works with the Squarespace cookie banner, so visitors who accept marketing cookies are tracked as normal and visitors who decline aren't tracked at all.
The only slight oddity is that Squarespace's banner doesn't hold back code you've added through Code Injection on its own. So instead of the normal one-line Converly code, you paste a slightly longer version that waits for the visitor's answer first. It sounds technical, but it's simply a copy and paste.
To set it up, follow the instructions below:
Step 1: Set your cookie banner to opt in
The first step is to make sure your cookie banner actually asks visitors for permission. In Squarespace, open the Cookies & Visitor Data settings, switch on Cookie banner, and choose Opt in & out. This shows your visitors a button to accept and a button to decline.
Step 2: Find your site key
Next, grab your Converly site key. In Converly, click Install in the left sidebar. Your install code is shown at the top, and your site key is the part after key= (it starts with site_). Copy it somewhere handy.
Step 3: Replace your Converly code
The final change is to swap your normal Converly code for the version that waits for consent. From your Squarespace dashboard, open the Website menu, then go to Website Tools, then Code Injection.
In the Header box, find your existing Converly code and delete it. Then paste this in its place:
<script>
(function () {
function marketingAccepted() {
try { return window.getSquarespaceCookies().marketing === "accepted"; }
catch (e) { return false; }
}
function loadConverly() {
if (window.__converlyLoaded || !marketingAccepted()) return;
window.__converlyLoaded = true;
var s = document.createElement("script");
s.src = "https://js.converly.io/v1/loader.js?key=YOUR_SITE_KEY";
document.head.appendChild(s);
}
window.onCookieBannerInteraction = loadConverly;
document.addEventListener("DOMContentLoaded", loadConverly);
window.addEventListener("load", loadConverly);
})();
</script>Replace YOUR_SITE_KEY with the site key you copied in Step 2, then click Save.
Important: Make sure you delete the old Converly code. If it's still there, Converly will run for every visitor whether they accept cookies or not.
This code checks the visitor's answer as each page loads, and again the moment they click accept, so Converly switches on straight away when they say yes.
Step 4: Test it works
That's it! The final step is to test it, and it only takes a couple of minutes.
First, open a new incognito window (or private window) and go to your website. When the cookie banner appears, decline marketing cookies. Then submit a test entry through one of your forms.
Now open the Activity page in Converly. The test entry should NOT appear there, because Converly never ran for that visitor.
Next, close that window, open another new incognito window, and go to your website again. This time accept marketing cookies (or click accept all), then submit another test entry. Head back to the Activity page, and this time the test conversion should show up within a moment.
If both of those happen, your cookie banner is holding Converly back properly.
