How to add google analytics to your wordpress site without any plugin.

Probably one of drawbacks of building your site in WordPress is that you have to use lots of plugins; there is virtually a plugin for anything you do in WordPress site. While plugins do make your life easy by automating many tasks that otherwise would take a long time and considerable efforts, they do clog up your site and in many cases can make them slow¬† –¬† a factor that may count agaisnt your website when it comes to search engine rankings.

Things you would need to do to add google analytics manually

Get your Google analytic code for your site: If you already have your google analytic code then skip this part. If you don’t have analytic code then you can always have it by signing into your google account and then going to Google analytic page. If you don’t have a google account at all (really !) then sign up for one.

Once logged into your analytic account Click on Admin > Tracking info. > Tracking Code. (see image below)

google analytic account

Copy the tracking code you have been given by Google and head to your wordpress blog…

google analytic code

Log on to your WordPress dashboard and then click on Appearance…

wordpress dashboard

followed by Editor.

wordpress dashboard

Now in right side of your wordpress template, you will have a panel of various .php files and one of them going to be Theme Header followed by header.php name underneath.

wordpress header.php editing

Now click on header.php file to edit it and once the file is opened, find the </head> code on the page. If you having difficulty finding it, simply press ctrl-f (command for Find) and in the box that appears just type </head> and hopefully it will be highlighted.

wordpress header.php file

Now paste the Google analytics tracking code you had copied earler just before </head> code. Save or update the header.php file and your tracking code is now promptly inserted in your website.

Leave a Reply

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