Today I'm going to show you how to track form submissions and newsletter sign up conversions from you Squarespace website in Google Analytics. We'll do this using GA Goals.
There are three things we'll need to get this set up:
- Contact form / Newsletter block
- A page users are redirected to after submitted the form
- Set up a new goal in Google Analytics
Let's get started!
1. Set up a contact form / newsletter block
Go ahead and set up either a contact form or newsletter block. Next click on "Advanced" and scroll down until you locate the "Post Submit HTML".
Copy and paste the code below into the Post-Submit HTML box and replace "your-url" with the last part of URL you would like to use.
<script> window.location.replace("/your-url"); </script>
If you have a page already then great, if not move on to step 2 and create one. You can then return to the contact form to replace the piece of code with your URL.
2. Create a new page for users to be redirected to
As we'll be tracking a page destination for the goal, we're going to need to create a page for the user to be redirected once the form has been submitted.
Go ahead and create a new page in Squarespace under the "Not Linked" section and give it a name.
Here's a snapshot of our page. We provide step by step instructions of how to confirm your subscription to our newsletter.
If you're setting up the page for a contact form submission you can always create an "enquiry confirmation" page. It's definitely worth spending a little bit of time researching what others are doing, there are some creative ideas out there!
3. Set up a new goal in Google Analytics
Login to your Google Analytics account and head over to "Admin" and under View click "Goals".
Now let's create a new goal.
In goal setup, choose template. As we are tracking newsletter sign ups choose "Sign up". If you are tracking contact form submissions in the form of an enquiry, under Acquisition select "Submit Content" and click continue.
For Goal description, give your goal a name. This is the name it will have in Google Analytics so choose wisely. We left ours as the default "Sign up", but you can choose whatever works for you.
Choose a new goal slot and then for Type select "Destination" as we'll be recording conversions when users reach a defined page. Now click continue.
In Goal details select the Destination to "Equals to" and enter the last part of your page url and click save.
Now that you have your new goal set up, all visits to that page from this point onwards will be recorded as a conversion in Google Analytics.
You won't have any conversions at this point as you have only just created the goal, however to check that everything is working follow:
- Open up your destination page in a new tab
- In Analytics go to Reporting > Real Time > Conversions
You should now be able to see your active goal, as indicated below.
To view your conversions outside of real time head over to Conversions > Goals > Overview, here you will see a detailed breakdown of all your completed goals over a given time period.
Congratulations, that's it! As you can see, it is really easy to set up goals in Google Analytics to track your Squarespace form submissions.
If you have any questions or suggestions I would love to hear about them. Please feel free to include the in the comments below and I'll get back to you!