Squarespace Hack: Google Analytics

While we all love the Squarespace statistics that can be accessed from our Website Management dashboard, many users still like to concurrently keep track of their site's traffic with Google Analytics.
If you'd like to implement this on your own site, here's how:
After setting up an account with Google Analytics and generating your unique tracking code, the key to accurate stats is ensuring that the code is installed on ALL of your Squarespace pages. Now, this doesn't mean that you need to manually install the code on each and every one of your pages one by one.
The Squarespace Manual offers the following bit of scoop:
You add the code directly to your footer, which can be accessed on any page on your site in Content Mode by clicking on "Edit Website Footer."
Finito!
Your unique code will now appear on every current AND future page of your Squarespace website!
P.S. In case Google Analytics isn't your thing, this hack will work for any other bit of statistical tracking code as well.

E. Reitman
Reader Comments (13)
I have been using Google analytics since I started my squarespace site, but I was under the impression that all of these type of scripts should be placed in the footer so they load last, because they often hang and cause the page not to load if placed in the header.
I'm not sure though, just my two cents, I am trying out the header code injection though to see if it does indeed effect my performance.
Thanks for the tip.
Thanks for the post.
I have been using Quantcast's code in my footer for sometime now . . . I'll give Google Analytics a try . . . maybe both (hmm, see what happens).
Any thoughts on the accuracy of SquareSpaces stats?
Thanks again.
@Mike - Adding Google Analytics to your site IS best suited to go in the footer for the reason you stated. I updated the post to reflect that, good catch.
Mine keeps saying 'Tracking Not Installed ' even after pasting the code on the footer.
Yep, I've been using Google Analytices on my squarespace site in this way for a couple of months now. Works great!
This is good for a global insertion of the basic Google tracking code, but how do you add Google's conversion code just to specific pages like form thank yous?
Im having the same problem with Frank which i need to to install some Google Conversion Tracking code for one of my client. Is there a way to insert the code only on specific page?
I been doing some google/squarespace help search and cant get an answer
I would love to know if there is a solution for this problem. Its critical to our design! I have figured out that you can incorporate html in the confirmation message. So, I was putting some text that said something like "Click here to confirm your submission" to get them to click the link which would send them to a thank you page which would accomplish the need for a landing page. Here's the glitch. For some reason the Squarespace code directs any link you type in the html to a subpage of the page the form is on. So if you are on a page called www.yoursite/productA" and that is where they submit the form, it seems that no matter how you construct the link it always adds /product in front of the link. So trying to send them to www.yoursite/thankyou becomes /productA/www.yoursite/thankyou. I was hoping someone might have a work around for this. Its not the best solution obviously to have a 2 step form submission but its better than nothing if its the only way you can get to a landing page. Just need some help figuring out to solve the above issue. Please help if you can!
For those having trouble with this, make sure you put the correct variable in your code snippet (starts with UA-)
@ May 28, 2009 | Registered CommenterT. Thompson
Mine keeps saying 'Tracking Not Installed ' even after pasting the code on the footer.
I had the same problem, at first i pasted the code on top of the html section on the footer and after that i had some stuff for my logo.
When i moved the "Google analytics code" to after all the stuff I had for logo, it worked.
so, try putting your code after whatever html you already have in the footer. see if it works.
how do you deal with custom URLS?
i have two URLS and want to track both of them
i inserted tracking for one of the domains, do i need to add two sets of tracking code to both?
Thanks! Since this thread is from last year, is this still the preferred method?
So should I not put the google analytics code in the <head> tag using website management - code injecton?