Easy to follow tutorial how to insert or put Google analytics code in your wordpress blog theme file.
Google analytics is one of several ways to track your blog’s visitors, like, where they come from, which search engine brings you the most traffics, or which referral websites your visitors come from, and many more.
The most useful is you will know how many visitors you receive a day or some specific period of times. I added my blog to Google Analytics right after submitting my sites to search engines, like Google, Yahoo, Bing, and Ask. The result will usually show after a few days.
I have decided not to use any Google analytics plugins for this, because we can easily do it without plugin. Do remember, using too much plugins can slow down your page load, and sometimes buggy while upgrading your blog.
So this is how i get Google Analytics code and paste it in my wordpress file or it will work for any html static websites too (I use twenty ten theme of wordpress 3 for this tutorial):
1. Go to this URL: https://www.google.com/analytics/reporting/login and sign in with your gmail account.
2. Click “sign up” button.
3. In “New Account Signup” type in:
-Website’s URL = www.yourwebsiteaddress.com
-Account Name = your web address by default, i left it as it is.
– Time zone country or territory = where you are at.
– Time Zone= Type in to suit your time.
4. Next, type in your first, and last name, the country and click “Continue”.
5. Read the Terms and Conditions of Google Analytics, and after all ok, tick “Yes, I agree to the above terms and conditions. Then hit “Create New Account” button.
6. If we did all correct, the next step is you will see your tracking codes. Copy all of the codes, and Go to your wordpress dashboard admin page.
7. Click Appearance/Editor and look for footer.php.
I personally paste the code in footer of my wordpress theme file, not in </head> as it shown in Google analytics page. Most people paste it in footer, and i never had any problems with having the code in footer.
Open up this footer.php file, and paste the code right before this code:
Click “Update File”.
Note: There are some theme files which provide you only to add the Google analytics ID, if your theme has this function, then just add the GA ID which is displayed in your code too. (see image).
8. Back to Google analitycs page, the last step, is hit “save and finish” button.
9. You will see the website profiles tables, and see your wordpress blog’s URL too. After a few days, check to see the report by clicking “view report” link.
That’s how i copy and paste Google analytics code to my wordpress blog, did you do differently? 🙂