How Do I Install Google Analytics?

Google Analytics is pretty easy to install. You will need to have some way to edit either the entire code for the page or to edit your main site template files.

If you have FTP access to the site files, you can achieve this with a simple text editor. If you are using a template driven site builder, you will need to find the main page templates, and switch to HTML view to edit them.

Once you have access, you can begin. Go to http://www.google.com/analytics/. You will need to sign in with an existing Google account, or create one.If you choose to create a new account, it can be for your existing email address or you can even create a new Gmail address as well.

Once you have the account created, you have to add the first Analytics account. The process is fairly straight forward. If you are not already in the New Account screen, click the new account button now.

Top Tip: Always create a new website as a new Account, NOT a new Property inside another account! If you wish to give another person access to your full Analytics account in the future, they will have access to all Properties inside the account. By splitting them up you can make life easier in the future.


You will need to give it the Account name. I usually use the URL, but it's for your display only, so ffel free to shorten it. You will also need to give the URL (full website address), the time zone and the country. At the moment. you selects whether the site uses http://, https:// or something else in the first box, and the rest of the URL in the second. If you site uses www. make sure you include it.

Next you will be presented with a page with the tracking code. Leave the selection at Standard and Single Domain. These will be fine unless you have more complex needs outside the scope of this blog.  Copy the tracking code - select all of the text in the box and do right-click>Copy or CTRL-C on your keyboard.

Next, on your website editor, you need to locate the tag that says </head>. It is usually near the top, and there should only be one in the page or document. You can often use Find (CTRL-F) to locate it. Go to the line above this, enter a new line and paste the code in.

Save the web page or template, and upload it by FTP if you need to.

If you have multiple pages, or more than one template, repeat the process on every page or template. It must be on all the pages on your website for it to work properly.

Top Tip: Adding the tracking code can be easily missed on some pages. Check especially for 'Thank You' pages that load after a form is submitted, 'Static' or 'Fixed' pages for blogs that often use a different template from the main blog posts and the home page, which again can sometimes use a different template.


Some website and blog creation systems have Google Analytics built in, and all they need is the reference number. On you Analytics account, have a look at the top of the page. It should say:

Tracking ID: UA-30109067-1

That code, starting with UA is the tracking code. Paste it into the correct space and save - you generally don't need to do anything else.

Testing Your Google Analytics Tacking Code

Now it is installed, you need to test it. The fastest way is the new Real Time Tracking. It is currently in Beta (testing). Click the Home button on your Analytics account, then select 'Real Time' on the far left menu and select 'Overview' once the menu opens.In a separate browser window, go visit your new site, and you should see one visitor appear under Right Now in the main page section. Success!



Problems? If you do not see your visit after a few seconds, check that the newly added tracking code is appearing on the page. View the page source in your browser (generally right-click on a blank bit and then 'view source'). Look just before the </head> tag. If it is not there, try refreshing the page, and if it is still not there go back to your editor and make sure you saved it.

Lastly, it's a good idea to check all the pages have the tracking code added. Use either the Real Time viewer or the 'view source' method to check all the major pages or page types. This can be list views, individual item views, forms/contact pages, the home page. If the code is missing from one page it can create some very odd numbers later in Analytics, so it is a good idea to check now.

That's it - well done. Give yourself a pat on the back.  Come back in a few days to see how the site is performing. Now all you have to do is get people on it.

Top Tip: The main Analytics reports are NOT real time, and can take several hours before data from site visits is available. For safety, generally only look at data up to the day before when reviewing your site.



That's all for this one. If you have any specific questions about installing Analytics, please ask in the comments below.

No comments:

Post a Comment