Majority of websites and blogs I read generally recommends 2 ways to install Google Analytics in wordpress blog.

These websites and blogs recommends that Google Analytics should be installed in wordpress blog in the following ways:
  • By using a wordpress plugin

  • By Pasting the Google Analytics Code
There are lots of wordpress plugins to choose from where Google Analytics can be installed.

One blog I read said that it is not advisable to follow Google's recommendation of pasting the google analytics tracking code directly into the header.php of your wordpress theme.

The argument mentioned was that if you change theme, the tracking code will be gone, you will not going to use the same theme forever, the blog site further said.

That blog recommended using plugins to install the tracking code.

The following wordpress plugins are mentioned and mostly recommended by the more popular wordpress blogs.
By Pasting The Google Analytics Code
  • In the functions.php file of your wordpress theme

  • In the header.php file of your wordpress theme
In my wordpress blog, I choose to paste the code in the header.php of my wordpress theme.

Several blogs I read said to paste the tracking code immediately below the <body> tag then click update file.

Some blogs say to paste the code just about the closing head tag and click update file.

I was confused so I went directly to the Google Analytics help page and read myself.

The help page says to Paste the Google Analytic Code immediately before the closing </head> tag.

Following Googles recommendation, I pasted the code immediately before the closing </head> tag in the header.php file of my wordpress blog.

Add the Google Analytics Code to Your WordPress Theme.

1. Copy the tracking code

2. Go to your WordPress Admin and then Appearance > Editor

3. Open your themes header.php file and directory underneath the <body> tag, paste the tracking code.

 Note: Googles recommendation is closing </head> tag in the header.php file

 After Installing The Google Analytics in any of the ways mentioned above, Go to your Google Analytics account and check if it is working in your wordpress site.

To Check Whether The Tracking Code Is Working Or Not Google Made The Following Instructions:

1. Sign in to your Analytics account.

2. Navigate to the property to which you added the tracking code.

3. Click Tracking Info > Tracking Code.

4. Review the tracking code status message. Near the tracking ID (UA-XXXXX-XX), you’ll see one of the following status messages:

a. Waiting for data

b. Tracking not installed or not verified

c. Receiving data

d. Unknown