Bates70's Blog

Health, Traveling, Automotive, Electro, Computer, Phone n Gadget, Photography and Documentary

Posts Tagged ‘Google Analytics’

How to Install Google Analytics in WordPress

Posted by bates70 on December 17, 2010

How to Signup with Google Analytics

First you would need to create a Google Analytics account. To do this, visit Google Analytics Signup Page.

You will see a screen like the one below. If you already have a gmail account, then use that to sign-in with. If you do not have a gmail account, then you would have to create an account for yourself.

Once you sign-in with your gmail account, you will be prompted to a screen like the one below. This is where you will signup for google analytics with your gmail account.

The third step would be to enter your site information. The fields are pretty self explanatory. You enter your Website’s URL, Account name (it can be anything that you like), Time zone country, and the time zone.

Step 4 requires you to enter your contact information.

Step 5 would require you to agree with their terms.

Step 6 is where you will receive the code to paste in your site. This is the important part of the signup. Copy and paste this code in a notepad or a HTML editor and keep this screen open.

How to Install Google Analytics in WordPress

There are 3 ways to install Google analytics in WordPress. Direct paste, functions.php, and plugins.

Direct Paste Method

Copy the code that you received in Step 6, and paste it in your theme’s footer.php right above the </body> tag.

Functions.php Method

Add the following code in your theme’s functions.php file and don’t forget to paste your Google Analytics code from Step 6 here.

<?php
add_action(‘wp_footer’, ‘add_googleanalytics’);
function add_googleanalytics() { ?>
// Paste your Google Analytics code from Step 6 here
<?php } ?>

Plugins Method

There are tons of plugins available to add Google Analytics to your site. The two that we recommend are:

Google Analytics for WordPress by Joost de Valk
Google Analyticator by Ronald Heft

Once you have installed Google Analytics in your site, you can go back to the screen from Step 6 and click Save and Finish. Then you will be taken to the overview of your site’s analytics.

You can see the status have an exclamation work. This just means that Google hasn’t realized that you have added the code to your site. It takes Google upto 12 – 24 hours to start providing you with the awesome site stats that you need.

This is a must have for every blog, so get it now. If you have any questions then feel free to ask in the comments. If you like this article, then please share it with your friends on twitter and facebook.

Free WordPress.com sites cannot use Google Analytics.

Posted in Blog Stuff | Tagged: | 2 Comments »