Skip to main content

Getting Started With Google Analytics For Your Site

Posted on April 25, 2012 by nDeHertoghnDeHertogh

Everyone has heard about Google Analytics at some point. But what does it exactly do? It’s a web analytics tool that shows you how people find your site (for instance through a search engine, ads, etc), how they navigate through your website and how they become costumers. You’re also able to track your mobile websites, mobile apps and web enabled mobile devices, bot high end and non-JavaScript enabled phones. You can find out which browser and which operating system your visitors use, which search queries they use and what the landing pages are. You can also see how many new and returning visitors you have. And what’s also important to know is how long they stay on your website.

For static pages (html) it is actually very easy to install. You just go to and search “google analytics” and click on the first link they provide. There you can sign up for an account. You just have to create a new Google account, or sign in with your Google account if you already have one. If you already have an AdWords account, just login to that account and click on the Analytics tab to sign up.  They will provide you some custom JavaScript that you just have to add to each page of the website, right before you close your head tag (</head>). Now just upload all your files again with your ftp client and you’re done! You now have Google Analytics for your website.
When you have dynamic pages you have to do it slightly different. There are two options: if you only have one page you can do exactly the same as with a static page (copy/paste the small piece of JavaScript right before you close the ‘head’ tag. However, if you have multiple dynamic pages it’s better to put the JavaScript in a separate file and save it (for instance analytics.php). Now you just have to include it to all your pages. You can do this by writing <?php include_once(“analytics.php”) ?> right after you open the body tag (<body>). All that you have to do now is uploading all the files again (including the new analytics.php file) and you’re good to go.
NOTE: If you don’t see any results don’t panic! Click the ‘admin’ button and click on ‘tracking code’. There you’ll see the Tracking Status. If you’ve installed it correctly it will say “Receiving Data”. Go back to the standard reporting. If you still don’t see anything (make sure you’ve visited your site a couple of times), make sure to check the date (view image below). For some reason Google always puts as end date one day earlier. If you correct the end date you should see your traffic.




Image of Abiodun
8 years ago

it also works for non-static sites too even e-commerce I use it alot.

Leave a Reply

Your email address will not be published. Required fields are marked *