Adding Google Analytics To BANS Or Any Dynamic Website

No Gravatar

Google Analytics, analysing traffic and where it comes from is very important for a webmaster to do on all of their sites.

It’s another of those two minute jobs that sometimes gets overlooked. It can be quite addictive looking at what your visitors have been looking at on your site. It will also help improve the overall experience your loyal visitors have when there, if you act on what visitors don’t seem to like that is and enhance what they do!

So here is the very simple yet not always apparent way to install Google Analytics to a website.

First of all create a Google Analytics account
Once inside your account click the link to add a site. Then click finish.

You will then see a box with lots of code in it looking similar to this

<script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-xxxxxxx-x”);
pageTracker._trackPageview();
</script>

Copy this code EXACTLY as it is into the position described below.

For sites that have a theme or template system find the footer.php file and place the google analytics code just above the </body> tag. Doing this in the template will ensure the code is put on every page you currently have and every page you create in the future.

For BANS users go to templates select the footer.php file near the top of the page and paste the code again just above </body>. Don’t forget to save your work.

I should say here that if your site does not have a common theme (template) then you will need to install the google code onto each page you have already or go on to create in the future just above </body> in the html files.

If you have installed the code correctly Google Analytics will default to saying something like “collecting data”. Check back in 24hours for your first results. If the code has not been installed correctly this will be apparent on your Google Analytics dashboard. It will say “tracking not installed”. Most likely this will be a simple fix. Any issues post a comment and I will see if I can help.

Installing this simple little script will give you tons of informed data about your visitors. Google Analytics works on human generated data only so you can be sure it isn’t collecting the data of the robots (bots) visiting your site. Use the information returned to keep your site a top quality place for visitors to come. You will of course also learn what is working from a marketing point of view and what isn’t, vital!

Hope you found this useful.

Related posts:

  1. Make Your Website Or Blog Rock By Adding FREE Images

, ,

2 Responses to Adding Google Analytics To BANS Or Any Dynamic Website

  1. BenNo Gravatar July 3, 2009 at 6:52 pm #

    I did the steps above and it has been collecting data for 4 days.
    I dont know what to do?

  2. adminNo Gravatar August 7, 2009 at 3:21 am #

    Hi Ben when you say it has been collecting data is it producing reports in your Google Analytics account so that you can see all of the relevant stats?

    Thanks
    Lynne

Leave a Reply

CommentLuv badge