Google Analytics is widely used traffic tracking software. You can use it to track your visits and visitors – where are from, from what source visitor came to your website, how long visitors stay at your page etc. This tutorial on how to install Google Analytics should be very easy and I’ll show you how to insert GA (Google Analyitcs) code in WordPress 0r just normal static page.
First, you need to go Google.com, login and then go here:
and click Sign in.
In the right upper corner you should see Admin button. Click it.
Now you’ll see list of accounts. If you don’t have account, create it, otherwise click on account name stated below. If you have an account already, scroll down a bit.
Creating new account
In case that you didn’t create account – click + New Account
Fill out that form and scroll down. Agree with the terms and click Create account
But, if you have an account, you just need to click on account’s name
As you can see name of my account is Lektira.me and I’ll click on it.
Now to generate code, you need to add New property
On image below you’ll see how I filled out the form.
Now, you will be landed to a new page. There you will see generated code ready to be inserted in your new website or blog.
Scroll down and copy that code into notepad first.
Now, depending on the platform you use, I will show you how to add this code.
Adding GA code to WordPress
There are different ways to add Google Analytics into your WordPress blog. I will show you most simplest one first.
Inserting code into the footer.php
You need to open your favorite FTP client and login to your server. Now if your theme is called for example WordFinder go to wp-content/themes/WordFinder (or name of your theme) and look for footer.php
Sometimes is footer.php located in /includes/ folder.
Download footer.php (but first back up it) and open it in Notepad.
Now in first line of code you will usually see <php> or </div> or <div>. Put your cursor just before such tags and press ENTER 1-2 times to move that PHP code down and paste your GA code at the very beginning of notepad content.
and after that add <html> and <head> tags like I did here:
So basically it goes like this:
< rest of some code………..
Pasting code in theme options
Some themes have in-build form for adding GA code.
Google Analytics Plugin
You can use plugin to add tracking code into your website.
Adding GA code to Blogger
Paste your Google Analytic’s code into Blogger’s HTML code (Template > Edit HTML) just before </head> tag like I did here:
Adding GA code to static page
If you have static website, adding code to static page is same as adding code to blogger. Open your index.php and add code just before closing </head> tag.
How to know if you successfully added code to your website?
After you added code to your website, wait 2 minutes and refresh Google Analytic’s.
Tips and Warnings
- You can’t see information on traffic until the next day
- Google Analytics is refreshing data one time a day and it’s not real-time tracking