Incorporating Google Analytics With WordPress

Google Analytics WordPress

“Google Analytics” is one the most important tools that every webmaster needs. Gathering intelligence about the traffic on your website and its thorough analysis will help you reach the full specter of opportunities related to your website. Geographical positions of your audience, screen resolutions of their devices, flash and javascript support, language areas and highlights of the day are just some superficial features that you can track with it. This data is of great use, when it comes to preparing the material for your targeted audience and the future optimization of your website for various search engines.

If you want to be heard of on the web, you must adapt your whole website to the audience you wish to reach. Not a single successful website with a growing audience has gone through at least one reconstruction phase. The web is an open place, so there are no limits to the content you can reach. It is exactly because of that trait that your audience is most often from different geographical, cultural and language areas. For example, if you are a company from Montreal, Canada that has its focus on the local market, you won’t get much from your website if 80% of your visitors are from Europe. Gathered intelligence will help you in performing changes in the design and content of your website so that you are more focused to the local audience.

First step: Sign up for Google Analytics

You do this with your Gmail account – the process is easy and it’s free. There are two account types between which you can choose:

  • Classic Account
  • Universal Account – currently in beta version, but it has a great deal of extended features
    The Universal account also comes with classic account features, so it really doesn’t matter which one you choose.

Second Step: Incorporating it in WordPress

There are three different ways you can incorporate Google Analytics into your WordPress website:

  • By installing a plugin
  • By directly pasting the tracking code in “header.php”
  • By adding the code in “functions.php”

The Choice of plugins

Installing a plugin is the most recommended method, being that not all WordPress users are experienced in coding as much as they are specialized in tracking and analysis. Benefits of using a plugin is that you need not edit each page for tracking – it does the work for you. However, there is a great number of these plugins which are not regularly updated and they become incompatible with newer versions of WordPress. If you are after a reliable plugin, I suggest you perform thorough research.

Ctrl+C & Ctrl+V

When you sign up for a Google Analytics, you will get a tracking code that needs to be implemented directly in the “header.php” file just after the “” tag. This will allow Google Analytics to access your website and track traffic and visitor interaction on it. After copying it, it takes from 12 to 24 hours until the tracking of your website begins.

A little bit of coding

This process is for advanced WordPress users. The most reliable way to implement Google Analytics into the core of your website is to directly access the “functions.php” file located in the theme installation folder. Less experienced developers most often make a mistake by implementing the tracking code in the “functions.php” file from the WordPress installation directory – make sure you find the right one. Here is a path example of where the file is located:

» your_website_domain/wp-content/themes/your_theme_name/functions.php

Here is an example of how the code should look like:

add_action('wp_head', 'add_googleanalytics');
function add_googleanalytics() { ?>
// Add Google Analytics code here
<?php } ?>

Remember to check for errors and save. After doing this, you are all set.

One thought on “Incorporating Google Analytics With WordPress”

Leave a Reply

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