Jump to content

How can I track form submissions in Google Analytics?

Go to solution Solved by foleyatwork,

Recommended Posts

Posted

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!

  • Replies 57
  • Views 56.1k
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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!

Posted

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!

Posted (edited)

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
Posted

Thanks for that work-around. Creating a separate Thank You page for my forms seems to have worked great in terms of tracking them as goals in Google Analytics. And I like the user experience better this way as well. So thanks again - much appreciated!

  • 4 weeks later...
Posted

I tested this out and it doesn't work on Squarespace 5 - the page won't redirect after successful submit. I think the Post Submit HTML section in the form doesn't support javascript. any ideas?

  • 4 weeks later...
Posted

I'd like to know if the original code foleyatwork (apr 17 '13) shared is still up-to-date for tracking form submissions on Google Analytics?

  • 1 month later...
Posted

I added this code into the footer with code injection and it doesn't seem to be picking up any of the submissions as an event on Analytics. Does this code still work or is it different now or does it work differently with Universal Analytics?

  • 3 months later...
Posted (edited)

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
  • 4 months later...
  • 8 months later...
Posted

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).

Posted

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!

  • 5 weeks later...
  • 2 months later...
Posted (edited)

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
  • 2 weeks later...
  • 1 month later...
Posted

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.

  • 3 months later...
Posted

For anyone else struggling with getting the new Thank You page to come up-Make sure that you aren't logged in as administrator - it won't work if you are logged in.

  • 5 weeks later...
Posted

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

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.