Jump to content

How can I track form submissions in Google Analytics?

Go to solution Solved by foleyatwork,

Recommended Posts

Can someone please confirm whether webbroi's answer above will work with Google's Universal Analytics? I have UA running on my Squarespace site and just want to make sure I'll be able to track form submissions by inserting the following code into my form's Post-submit HTML box?

Thanks!

Link to comment

Has anyone figured out a solution to this yet?

For the record, I added the code listed above to the Post-Submit HTML box in the form settings on one of my site's pages...and also updated the Category / Action / Label information, and it did not successfully send any Event information to Google Analytics.

Figuring out how to track form submissions as trackable Events in Google Analytics is a very important part of my site's reporting so I would greatly appreciate any help in figuring this one out! Cheers!

Link to comment

Has anyone figured out a solution to this yet?

For the record, I added the code listed above to the Post-Submit HTML box in the form settings on one of my site's pages...and also updated the Category / Action / Label information, and it did not successfully send any Event information to Google Analytics.

Figuring out how to track form submissions as trackable Events in Google Analytics is a very important part of my site's reporting so I would greatly appreciate any help in figuring this one out! Cheers!

Link to comment

The easiest method I have found, also has some benefits by using a /Thank-you page.

  1. Create a new /Thank-You page in Squarespace
  2. Edit your Form on your /Contact page. Under advanced add this simple script to the Post Submit HTML

window.location.replace("/thank-you"); (note: add the script beg and end tags)


<script> window.location.replace("/thank-you"); </script>

  1. Create a Google Analytics Goal for the /Thank-you page

This method also lets you track the /thank-you page in page views, to help troubleshoot issues. We also added a redirect to the homepage. You can do all sorts of thing with your /thank-you page pushing your users to other content etc.

Update: I have confirmed this still works, with standard "stock" squarespace GA implementation. Not tested with Universal via code injection.

Edited by webbroi
Link to comment
  • 4 weeks later...
  • 4 weeks later...
  • 1 month later...
  • 3 months later...

webbroi- I created a new thank-you page and also added the script you provided to my contact page in the advanced section. However, now my contact page just automatically redirects to the thank-you page instead of redirecting after someone submits an inquiry. What am I doing wrong??

Edited by MichelleKF
Link to comment
  • 4 months later...
  • 8 months later...

I'm experiencing problems pasting the Adwords-code in a Squarespace 7 cover page.The cover page works fine with a button allowing to fill out a form. If I paste the Adwords code into the post-submit HTML-box, this invalidates the button (I can still see it, but I can't click on it anymore).

Link to comment

Okay, I just realized that my last message wasn't very clear.I have a lightbox form installed on a Squarespace cover page. Form submission would be considered conversion in Adwords.When I paste the Adwords Code in the post-HTML-box the form isn't accessible anymore (the click-through button is still visible, but I can't click on it anymore).www.contrastdeco.fr/decorateur-offre

Thank you!

Link to comment
  • 5 weeks later...
  • 2 months later...

I couldn't get either of the code snippets offered here to work. But they would only work with GA Classic. I was able to get conversion tracking set up successfully with Google Tag Manager, GA Universal, and minimal code injections.

I described the method in reply to another post:https://answers.squarespace.com/questions/60229/how-can-i-track-form-submissions-with-google-tag-managergoogle-analytics-in-v7.html#answer-121964

( @foleyatwork )

Edited by Guest
Initial Revision
Link to comment
  • 2 weeks later...
  • 1 month later...

Hey Squarespace. Is this really the best solution? I continue to get emails of people asking abou this. My solution below works, and got 10 upvotes vs the 3 on this "best answer" Its really a bit confusing to me why this is not prioritized as a feature. Tracking goals should be at the top of the feature list for any webmaster or company with a website big or small.

Link to comment
  • 3 months later...
  • 5 weeks later...

The easiest most accurate way I have found to track form submissions in Analytics is to create a redirect to a thank you page or enquiry confirmation type page, using a script in the Post Submit HTML. All you do is have to then set up a new goal in Analytics and you can start tracking your form submissions.

I have recently put together a whole video walkthrough on the topic that you may find useful:http://www.atomicmarketing.co/blog/conversion-tracking-squarespace-google-analytics

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.