Skip to content
Browse the docs

Install Spurn on Squarespace

Spurn runs on Squarespace through code injection in your site's header. It does nothing on organic visits and starts work when a visitor arrives from a paid ad.

Before you start#

  • A Squarespace plan that includes code injection. Squarespace lists it on the Core, Plus and Advanced plans and some legacy plans.
  • Your site's public key from Spurn: Sites, then your site, then the Install tab (it is also on the Keys tab). It looks like sp_pub_XXXXXXXXXXXXXXXXXXXXXXXX.

Add the tag#

  1. In Squarespace, open the Pages panel, then Website Tools, then Code Injection.

  2. Paste this into Header, with your public key:

    <script async src="https://spurn.io/s.js" data-site="sp_pub_XXXXXXXXXXXXXXXXXXXXXXXX"></script>
  3. Click Save.

Code in Header runs on every page, which matters: a paid visitor often lands on one page and buys on another.

Report orders (optional)#

Detection and blocking work without conversions. Reporting them adds evidence: a click that led to a purchase counts in its favour, and the dashboard shows which paid clicks converted.

In the same Code Injection panel, Squarespace runs code on the page shoppers see after checkout: the Order Status Page for physical, download and service products, and the Order Confirmation Page for gift cards, memberships and subscriptions. Paste this into whichever ones you sell through, with your store's currency in place of USD:

{.if firstPageView}
<script>
  window.spurn = window.spurn || function () { (window.spurn.q = window.spurn.q || []).push(arguments) }
  spurn('conversion', { value: {orderGrandTotalCents} / 100, currency: 'USD', orderId: '{orderId}' })
</script>
<script async src="https://spurn.io/s.js" data-site="sp_pub_XXXXXXXXXXXXXXXXXXXXXXXX"></script>
{.end}
  • {orderId} and {orderGrandTotalCents} are Squarespace's own tags; it fills them in for each order.
  • {.if firstPageView} stops the order counting twice when the shopper reopens the page.
  • The second tag line makes sure Spurn is loaded on that page. If it is already there, it does nothing.
  • Only buyers who arrived on a paid click are reported. Spurn matches them through a cookie on your domain, so place a test order and check the click shows as converted.

Squarespace doesn't allow code on the checkout pages themselves.

Check it works#

  1. Add your own IP address to the allowlist in Spurn (Blocking, then Allowlist), so your tests are never blocked.
  2. Open your site with a test click id: https://yoursite.com/?gclid=test-123.
  3. Open Clicks in Spurn. The visit appears within a minute, and the site's Install tab shows Receiving.

A test landing counts as a real paid click and uses one credit.

Troubleshooting#

Nothing arrives. Check the code saved in Header, the site is not password protected for visitors, and the test URL has a click id. Visits without one are ignored by design.

Clicks are rejected for the wrong site. Spurn checks the page reporting a click against your site's domain and extra hosts. If the site also answers on yoursite.squarespace.com or a second domain, add it in Sites, then your site.

The tag is blocked. Ad blockers can stop the tag in your own browser; try a private window without extensions.

A consent banner holds the tag back. If your cookie banner blocks scripts until the visitor accepts, Spurn waits too, and visitors who decline aren't checked. The tracking template still records the IP behind Google and Microsoft clicks: /docs/guides/tracking-template.

Wrong key. The tag takes the public key (sp_pub_…). A secret key (sp_sec_…) must never go in a page; if one did, revoke it in Sites, then your site, then Keys.

What data is sent#

On paid landings only: the landing URL and referrer, the IP address and user agent, browser signals used to spot automation, and engagement such as time on page and scrolling. The order snippet sends the order id, grand total and currency. See /docs/detection.