Google Analytics


June 20, 2014 Maithilish

Chapter 9. Webmaster Tools

9.1. Google Analytics for WordPress

In the previous chapter, we finished Search Engine Optimization. In this chapter, we cover a related area, Webmaster Tools, that helps us tweak some of the left out areas. To start with, we try out Google Analytics and get insights into visitors who visit the site.

Google Analytics for WordPress

There are many products and plugins to gather and present analytics about the traffic to a WordPress site. We choose Google Analytics for our site for the ease of setup, customizable dashboard and reports. Even with the basic setup, we are able to get good insights from Google Analytics in these areas:
  • Real time view of visitors, their location, keywords, active pages.
  • Historic dashboards of number of sessions, session duration, new or returning visitors, page views, top pages, bounce rate, location, referral sites, browser, OS and devices used, etc.
  • Site and page speed, page timings and speed suggestions.
To setup Google Analytics for the site, we need to sign up to a Google Analytics account and then add the tracking code to the site’s pages.
Google Analytics Sign up

Open Google Analytics and click on Sign in, which takes us to the Google Accounts screen. If we have a Google Account then log in using the account else we have to create a new Google Account using Create an account link. After completion, it takes us to Google Analytics Sign Up page. Click Sign Up to open Google Analytics New Account screen.

Select Website tab and enter Account Name, Website Name, Website URL and Reporting Time Zone. Leave Data Sharing options to defaults and save the account by clicking Get Tracking ID.
Google Analytics creates a new account and take us to the Administrator screen, which shows the Tracking ID and tracking code for the site. Note down the Tracking ID, but there is no need to copy the tracking code as we are going to use a Plugin to integrate WordPress site with Google Analytics.
WordPress Google Analytics Admin screen.
Google Analytics for WordPress

We can add the Tracking Code provided by Google Analytics to the header or footer of the theme so that code adds to all the pages, but this leaves a lot of powerful features of Google Analytics unused. Instead, we use Google Analytics for WordPress Plugin by Joost de Valk.

Install Google Analytics for WordPress. Chapter 6, WordPress Plugins explains the Plugin installation.
WordPress Google Analytics for WordPress Configuration.
To configure the Plugin, open the configuration page with DashboardSettingsGoogle Analytics.
Select Manually enter your UA code and enter the Tracking ID noted down in the previous section, in the Analytics Profile field.
If you have not noted down the ID, go back to Google Analytics and go to AdminPropertyProperty Settings to get the Tracking ID.
Coming back to the Plugin configuration screen, we leave all other settings to defaults and save the configuration.
By default, Google Analytics for WordPress Plugin adds the tracking code to the page header.
Once configured, login to Google Analytics and go to Home page. Select All Site Data listed under the site to open the default dashboard for the site. From the left hand side menu, select Real TimeOverview and in another browser tab open some page from the site.
WordPress Google Analytics Real Time dashboard.
Real Time dashboard displays the details of the page we access. After some time, real time data accumulates to the other data dimensions:
  • Audience – Visitor details dashboards.
  • Acquisition – Referral sites dashboards.
  • Behavior – Site and page speed dashboards.
Refer Analytics Help Center for exhaustive literature on the Google Analytics features, setup and customization.
In the next section, we cover Google Webmaster Tools to gather some more information about the site.