Skip to main content
Support home / Integrations

SquareSpace

Adding the Fathom script to your Squarespace website is a quick and easy process. Here's how to set up your Squarespace site to work with our analytics:

Setting up the script

  1. Copy your Fathom Analytics script from your site settings
  2. Sign in to your Squarespace account
  3. In the sidebar under the Utilities section, click Website Tools
  4. Under the "Custom code" section, click Code Injection
  5. Paste your Fathom Analytics script into the Header text box
  6. Click Save
  7. To check the script is working, head over to your site and then check your Fathom dashboard to see if your visit was recorded

Collecting data for purchases

If you would like to capture sales data, you can do so using events. Here's how:

  1. Go to your Squarespace account and in the sidebar under the Utilities section, click Website Tools
  2. Scroll down to the Order Status Page section and add the following code to the text box:

Note: Make sure to replace the dummy Event Name with your desired Event Name in the example below

<script>
window.addEventListener('load', (event) => {
fathom.trackEvent('YOUR EVENT NAME HERE', {
_value: {orderGrandTotalCents},
});
});
</script>
  1. Click Save and your event will now start collecting data on each successful order, including the total order price
  2. To check if your event is working, create a successful order and navigate to the order status page. Once you have done that, check your Fathom dashboard to see if the event completion and the relevant value was recorded

Collecting data for form submissions

If you would like to capture how many form submissions you receive, you can also do that using events. The easiest method of doing that is by redirecting form submissions to a 'thank you' page, where you can trigger the event on page load. Here's how:

  1. Go to your Squarespace account and click on Pages
  2. If your forms don't already have a thank you page to which submissions redirect, you will need to create one. To create a thank you page, click the '+' button in the Not Linked section, select a page template, and give the page a name
  3. Access the thank you page's settings by clicking the gear icon to the right of it
  4. In the General tab, take note of the URL Slug (you will need it later)
  5. In the Settings menu, click Advanced and add the following script into the textbox:

Note: Make sure to replace the dummy Event Name with your desired Event Name in the example below

<script>
window.addEventListener('load', (event) => {
fathom.trackEvent('YOUR EVENT NAME HERE');
});
</script>
  1. Go to the page that contains your form and then edit the page
  2. Click on your form and then click on the pencil icon to edit the form
  3. Under the Content tab, click on the Post-Submit option
  4. Click on the Redirect tab, and in the Redirect URL field, add the URL Slug that you made a note of earlier (i.e., /thank-you)
  5. To check if your form submission event is working, navigate to the page your form is on and submit it. Once you have done that, check your Fathom dashboard to see if the form's event completion was recorded

Collecting data for bookings

If you would like to capture how many bookings you receive using Squarespace's Scheduling feature, you can also do that using events. Here's how:

  1. Go to your Squarespace account and click on Scheduling
  2. In the sidebar menu, click on Integrations
  3. Click on the Analytics & Conversion Tracking tab, and under Custom Conversion Tracking, if you don't already have it set up, click Set up. If you do already have it set up, click Edit
  4. In the HTML Tracking Code textbox, add the following code:

Note: Make sure to replace the dummy Site ID in the "data-site" attribute with your actual Site ID in the example below

<script src="https://cdn.usefathom.com/script.js" data-site="XXXXXX" defer></script>
<script>
window.addEventListener('load', (event) => {
const priceInCents = %price% * 100
fathom.trackEvent('Booking Scheduled', {
_value: priceInCents,
});
});
</script>
  1. Click Save Settings
  2. To check if your booking event is working, navigate to your scheduling page and book an appointment. Once you have done that, check your Fathom dashboard to see if the form's event completion and the relevant value was recorded


If you still have questions or require help with anything, please reach out to us and we'll happily get things sorted out for you.


Can't find what you're looking for?