Skip to content

Install on Squarespace

View as Markdown

Add Reveata to a Squarespace site with Code Injection, serve it from your own subdomain, and credit Squarespace Commerce orders to their visits from the order confirmation page.

On this page

Squarespace adds code to every page through Code Injection. It needs a plan with custom code (Core, Plus, Advanced, or a Business or Commerce plan on older pricing). On the Basic plan the code is kept but doesn’t run.

Copy the snippet from your Reveata dashboard (it contains your website’s tracking id):

html
<script
  defer
  data-website-id="ws_your_tracking_id"
  src="https://reveata.com/js/script.js"
></script>

Add it to your site

  1. Open Settings → Developer Tools → Code Injection (on older sites: Settings → Advanced → Code Injection).
  2. Paste the snippet into Header.
  3. Select Save. Code Injection takes effect on the live site straight away.

In Reveata, add the website with your custom domain. Your .squarespace.com address is another host: visits there are refused unless you add it under Settings → General → Additional domains.

Serve it from your own subdomain

Squarespace can’t run proxy code, but the managed proxy needs none. Add one DNS record (for example stats.example.com). For a domain registered with Squarespace, add it under Domains → your domain → DNS → Custom records. Then replace the snippet in Header with the new one Reveata gives you.

Revenue

Connect the payments. Squarespace Commerce charges through Squarespace Payments, Stripe or PayPal. If you connected your own Stripe account (Commerce → Payments), connect the same account in Reveata under Settings → Payments (restricted key or Connect with Stripe). Its orders then count as revenue.

Credit orders to visits from the order confirmation page. Squarespace’s Code Injection has an Order Confirmation Page field, and it fills in order details such as {customerEmailAddress} and {orderId}. Paste this there:

html
<script>
  window.reveata && window.reveata('payment', { email: '{customerEmailAddress}' });
</script>

The next payment with that email (from a day before to a day after) is credited to the visitor who just bought. This uses Match payments using browser identify calls in Reveata’s Settings → Payments, on by default. See Thank-you page payments.

Squarespace Payments or PayPal are not a Stripe account Reveata can read, so their orders aren’t imported. To count them anyway, turn on Settings → Payments → Accept unverified browser payments in Reveata and send the amount from the same field (the subtotal, without tax and shipping, in your store currency):

html
<script>
  window.reveata &&
    window.reveata('payment', {
      transactionId: 'sqsp_{orderId}',
      email: '{customerEmailAddress}',
      amount: {orderSubtotalCents} / 100,
      currency: 'USD',
    });
</script>

Replace USD with your store’s currency. These payments are marked Unverified, because anyone could send one from a browser. Use one of the two snippets, not both.

Check it works

  1. Log out of Squarespace (or use a private window), and open your site with ad blockers turned off for it.
  2. Open Realtime in Reveata: your visit appears within a few seconds.
  3. If nothing arrives, follow Verify your installation.

For revenue: open your site from a link ending in ?ref=test, place a small order, and refund it afterwards. The order appears under Revenue with the source test.

Goals

Squarespace has no field for attributes on its buttons. Use Goals → Add goals → Page visit, no code in Reveata with the path of a page people reach after the action, or add a button in a Code block with data-reveata-goal="signup". See Custom goals.

Common pitfalls

  • The Basic plan. Code Injection is disabled; the snippet stays in the field but never runs.
  • Checkout pages. Squarespace doesn’t run custom code on checkout pages. The order confirmation page is the place for revenue code.
  • The cookie banner. If the banner is set to hold back scripts until people accept, visits only count after they do. Cookieless mode needs no cookies.
  • Testing on .squarespace.com or in the editor. Test on your custom domain, logged out.

Was this helpful?