Setting up the script
- Copy your Fathom Analytics script from your site settings
- Sign in to your Squarespace account
- In the sidebar under the
Utilitiessection, clickWebsite Tools - Under the “Custom code” section, click
Code Injection - Paste your Fathom Analytics script into the
Headertext box - Click
Save - 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:- Go to your Squarespace account and in the sidebar under the
Utilitiessection, clickWebsite Tools - Scroll down to the
Order Status Pagesection 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
- Click
Saveand your event will now start collecting data on each successful order, including the total order price - 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:- Go to your Squarespace account and click on
Pages - 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 Linkedsection, select a page template, and give the page a name - Access the thank you page’s settings by clicking the gear icon to the right of it
- In the
Generaltab, take note of theURL Slug(you will need it later) - In the Settings menu, click
Advancedand 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
- Go to the page that contains your form and then edit the page
- Click on your form and then click on the pencil icon to edit the form
- Under the
Contenttab, click on thePost-Submitoption - Click on the
Redirecttab, and in theRedirect URLfield, add theURL Slugthat you made a note of earlier (i.e., /thank-you) - 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:- Go to your Squarespace account and click on
Scheduling - In the sidebar menu, click on
Integrations - Click on the
Analytics & Conversion Trackingtab, and underCustom Conversion Tracking, if you don’t already have it set up, clickSet up. If you do already have it set up, clickEdit - In the
HTML Tracking Codetextbox, 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
- Click
Save Settings - 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