How to Add Google Analytics to WordPress

If your blog is hosted with Hostgator or any web host that provides cPanel, there is a web stats software called Awstats that gives you visual data about your website visitors.

Google Analytics is a free tool that collects traffic stats as well, however, it also gives you a lot more marketing data such as visitor behavior.  This tool is a must-have if you are serious about blogging and tracking results.

Another reason to install Google Analytics is it allows other people to view your website stats (of course, you control who and what the person can see), which is a great tool for potential buyers to verify your traffic if you ever decide to sell your blog.

Here are a few traffic data that Analytics tracks, as well as how you can best use the data:

  • Who (demographics) is visiting your blog, so you can customize your sales message for the audience.
  • What keywords they use to find your blog using the search engines, so you can write more blog posts for related keyword to dominate the entire search spectrum for that topic.
  • What are your top visited page, so you can pay attention to those pages and monetize it better.
  • What website refers you the most traffic, so you can focus on marketing more on those referred sites (ie. Facebook, forums, other blogs, etc.)
  • How long your visitors stay on a particular page, so you can improve and optimize low-performing pages (longer visit time means better reader engagement!)
  • What browsers, desktop/mobile platform your visitors are using, so you can make sure your site is cross-browser, cross-platform compatible.
  • You can also set up custom conversion goals, such as when someone subscribed to your blog, or when someone traversed through “sales funnels” you’ve set up, and bought your product.  This allows you test and tweak for maximum conversion.
  • And much much more…

Here are steps to add Google Analytics to your WordPress blog.

Sign Up or Login to Google Analytics

Head over to http://www.google.com/analytics.  If you already have a Google account, simply click on Access Analytics and sign in.  If not, click on Sign Up Now to create a new account.

google analytics sign up

Activate Google Analytics

Nothing to do here, but to click on Sign Up

google analytics sign up

Create New Site Tracking Account

You will be asked to fill out your website information that you want Google Analytics to track.  Follow the screenshot below and where applicable, fill in your own site’s information.

google analytics create new account

Copy Your Google Analytics code

Next, copy (Ctrl-C in Windows, or Command-C in Mac) the code provided to you:

google analytics grab code

Paste Code In WordPress Theme File

Login to your WordPress Dashboard and click on Editor link under Appearance metabox:

appearance-metabox

Then click on Header (header.php) and paste your Google Analytics code right before the </header> tag:

google analytics paste code

The reason why you should put your Analytics code in header.php is simple – heaader.php gets included in all pages and posts of your blog so putting your Analytics code there ensures all traffic information is captured.

Check Back Tomorrow!

That’s all.  You are done!  Google will now start collecting web traffic and visitor behavior information for you.  Feel free to explore some of its features and read up on some of the best practices with Analytics.

Please click on the "Like" button if you enjoyed this article!

 
line
Powered by Wordpress | Designed by Elegant-Themes