Squarespace doesn't run custom code on checkout pages, but it does on the order confirmation page, and it fills in the order's details there. That is the hook Reveata uses to connect a Squarespace Commerce order to the visit behind it.
What you get
- Every page tracked from the Code Injection header.
- Commerce orders as revenue, when you connected your own Stripe account in Commerce → Payments.
- Each order credited to the visitor who bought, from the Order Confirmation Page field.
- Squarespace Payments and PayPal orders counted as unverified browser payments, if you choose.
How to install it
- Open Settings → Developer Tools → Code Injection (on older sites Settings → Advanced → Code Injection) and paste the snippet into Header. It needs a plan with custom code; on the Basic plan the code is kept but doesn't run. Squarespace explains it in Using code injection (opens in a new tab).
- In Reveata, add the website with your custom domain; the
.squarespace.comaddress is refused unless you add it as an additional domain. - Connect the same Stripe account in Reveata's Settings → Payments.
- In Code Injection's Order Confirmation Page field, call
reveata('payment', { email: '{customerEmailAddress}' }). The full snippet is in the Squarespace install guide.
How orders are matched
The next payment with that email, from a day before to a day after, is credited to the visitor who just bought (thank-you page payments). This uses Match payments using browser identify calls, on by default.
Squarespace Payments and PayPal are not a Stripe account Reveata can read. To count those orders anyway, turn on Accept unverified browser payments and send the subtotal (without tax and shipping) in your store currency from the same field. Such payments are marked Unverified, because anyone could send one from a browser. Use one of the two snippets, not both.
Serving the script from your own domain
Squarespace can't run proxy code, but the managed proxy needs only a DNS record, such as stats.example.com. For a domain registered with Squarespace, add it under Domains → your domain → DNS → Custom records.