Squarespace
Keep your Squarespace Text and Button blocks in Fluid Engine. Version Compare can mark the existing button, or compare its label, without replacing the block with a Code Block. Squarespace still controls the block's position, style, destination, and editing fields.
Connect your agent and tell it which page, control, and outcome you want to measure. For example:
Keep the Book a call button on my Contact page and the one in my mobile menu. Check whether our existing confirmation goal covers these journeys. If we need to count clicks, inspect the rendered controls on desktop and mobile. Show me the proposed changes, test plan, and rollback before saving anything.
Your agent asks before inspecting live pages or account data, changing a goal or Code Injection, or making the change live. The Squarespace owner or administrator can apply the change if the agent has no editor access.
Choose what to count
Reuse a page goal if the action ends at a distinct destination that already uses the same Version Compare site. For example, count a visit to a booking confirmation page rather than the click that opens the booking form. You do not need to mark the button for a page goal.
If the click itself is the outcome, choose Named interaction. For an event named book-a-call, the rendered <a> or <button> must carry data-vc-goal="book-a-call". Enter the event name in Version Compare. A CSS selector only helps find the element on your site. The marker does not change the control's action, and it does not create a version set.
Find the rendered control
Use the browser's Elements inspector on the visitor page or preview canvas. Select the actual anchor or button, not its text, icon, or layout wrapper. These selectors illustrate what to look for, not what to paste unchanged. Squarespace does not promise to keep these IDs or classes stable.
| Control | Example selector |
|---|---|
| Button block link | #block-yui_3_17_2_1_1712345678901_12345 a.sqs-block-button-element |
| Desktop header link | #header .header-display-desktop a[href="/book-a-call"] |
| Mobile menu link | #header .header-menu a[href="/book-a-call"] |
For a Button block, copy the ID from the wrapper on your page. If the control is a <button>, use a selector for that element inside the block. For a site header, footer, or other Squarespace interface with no block ID, start from the nearest stable container you can verify. Match the link's literal href as shown in the inspector. It may be an absolute URL or have a trailing slash. If two links in the container use the same destination, narrow the selector to the intended header or menu area. For controls without an href, find a hook on the actual button within that area.
Check document.querySelectorAll(selector).length in the preview frame's console, with selector set to your own selector string. Check each match in Elements. Expect one match for a single Button block. For shared chrome, note the expected count and which matches are visible on desktop and mobile. Check the mobile menu closed, open, and reopened. A closed menu may have no link in the DOM, or it may already contain a hidden copy. Mark only the desktop and mobile controls that are meant to count.
Add the marker without moving the block
If you control the rendered HTML, set the attribute there. If Squarespace generates the markup, use the attribute adapter with the selectors you verified. It marks the existing element after render. Leave the destination, focus, and handlers alone. Do not add a click listener or send a second event. If Squarespace inserts or replaces the control when a menu opens or after navigation, use the adapter for replaced controls. Observe the smallest parent that stays in place. If the target is already present and stays the same, you do not need an observer.
Squarespace's Code Injection guide lists Core, Plus, Advanced, and some legacy plans. Checkout pages do not support Code Injection. Check that the panel is available on your site. Squarespace's permissions table lists the owner and administrators for Code Injection. Access to edit a block does not grant access to this panel.
Before changing a field, keep a copy of its current contents for rollback.
- In Code Injection → Header, keep one Version Compare browser script for the visitor journey. The Header field writes to
<head>, not the visible navigation. Reuse an existing installation. No private key belongs here. - Before the first Code Injection save, add the presence-only
data-vc-testattribute to that script tag on every page in the test journey. On ordinary pages, test mode selects versions normally without recording views or goals. The Squarespace editor still opens its unmeasured preview automatically where scripts can run. If the site already measures traffic, agree which pages to put in test mode before switching them. - For shared controls, put the adapter inside
<script>tags in Code Injection → Footer. Squarespace inserts it before the closing</body>tag on site pages. For a one-page change, use Pages → page settings (gear icon) → Advanced → Page Header Code Injection where available. This field writes to<head>, so run the adapter after the DOM is ready. Keep visible content in the native blocks. If the page field is unavailable but site injection works, keep one adapter in Footer and restrict it to the intended page path.
Compare native wording
Leave the fallback wording in the Text or Button block. If you control the initial HTML, use direct child version spans in the existing heading or label. Keep the original heading level and the native link or button. Put data-vc and a stable data-vc-id on the heading or label container. Give each direct child span data-vc-version. Leave the fallback visible and add hidden to the alternatives.
If Squarespace locks the markup, use the guarded wording adapter for below-the-fold or later-rendered content. Point it at a single text-only heading such as #block-yui_3_17_2_1_1712345678901_67890 h2, a text-only button, or its verified text-only label element. Give the set a stable ID such as contact-heading and supply the alternate wording in the adapter. The example uses the text from Squarespace as the fallback. If the label contains icons, formatted text, or other elements and has no separate text-only label, leave it alone. Do not overwrite or clone the whole control. If you also count clicks, the goal stays on the actual anchor or button.
Version Compare discovers valid version markup added after render. For a heading or button visible on load, put versions in the initial HTML. If you cannot do that, choose a later element. Adding versions in the footer cannot prevent visitors from briefly seeing the fallback.
Check without recording traffic
- In the approved preview or test-mode page, inspect the actual heading, anchor, or button. Check the match counts again after navigation or a menu reopen. Confirm the intended controls carry the exact
data-vc-goalvalue and unrelated links do not. - In the Squarespace editor preview, use Show versions beside a version set to try each wording. Confirm the heading level, accessible name, focus, desktop and mobile layout, and link destination. Check keyboard activation and the normal click action where it is safe to do so. The preview console reports the detected goal as
Version Compare preview: not recorded. If a link takes you outside the editor, check that the destination is also in test mode before following it. Preview and test mode do not stop forms, bookings, or payments from taking effect. - Edit the fallback in the normal Squarespace editor and check it again. Keep alternate copy in the adapter if you use one. Recheck the selector if you recreate a block or change a link destination. To roll back, remove only the adapter from the field where you added it, or remove the version or goal markup you added at source. Save, reload, and confirm the native fallback and behaviour. Leave unrelated Code Injection and the existing browser script in place.
Remove data-vc-test only after the owner explicitly approves launch. Save or publish the change and reload the affected pages. Visits after launch can count in your results.
Password-protected trial or demo sites
Use the clean site address in Version Compare. For a trial, use its built-in domain without /config, as in Squarespace's trial sharing guide. The owner opens that address in their own browser and enters the password on the Squarespace lock screen. With permission, the agent can inspect the unlocked page in that same browser session while test mode is on. Keep passwords and session data out of chat, tool calls, source, and logs.
A 401 does not stop you from registering the clean HTTPS address with a site name of your choice. When the agent already has the right Version Compare site, reuse it. Neither registration nor a successful request for the lock screen verifies the installation.
Do not append ?password=... to a shared or registered URL, even if a link like that opens in a browser. URLs can be saved in history or logs, or copied into another tool. Version Compare's remote static inspector cannot use your unlocked session. If it sees a lock screen or returns 401, the installation is unverified. Check the unlocked page in the browser instead.