A Primer on Deploying Google Analytics

Google Analytics (GA) can be a powerful tool for tracking the effectiveness of journalists to produce content for the widest audience possible online. At its most basic level, GA is a tool that provides statistics in near real-time on user engagement, the amount of time a visitor spends on a site, how many pages they viewed and where the visitor headed next. There are also advanced techniques that can expand upon these basic questions to expose journalists to detailed patterns of content consumption.

There are a handful of approaches to placing Google’s tracking code on a site. For basic tracking, it can be as simple as pasting the Google provided tracking code into the <head></head> of the main template on all of the site pages. Depending upon the CMS that your site is built on, there are a number of modules and plug-ins that manage the placement of a basic tracking tag site wide.

Fortunately, there are effective plug-ins/modules available for Drupal and WordPress, that provide additional functionality for detailed tracking of a visitors engagement. For a few examples of deeper integration of GA, see the case studies for The Huffington Post and WNYC.

How to properly deploy the Google Analytics tracking script in your template pages

If you do not have one already, you’ll need to create a new Google Analytics account. Once you’ve created a new profile for your site, you’ll be presented with a snippet of code that includes a unique Web Property ID specific to your account.

The tracking code example below is similar to the one provided by Google. It uses Google’s asynchronous tracking code. An additional feature included in the example, not included in the standard snippet provided by Google, allows a site to track the time it takes for each page to load (which is a useful feature in trouble shooting site performance issues).

<script type=”text/javascript”>

var _gaq = _gaq || [];
_gaq.push(
[‘_setAccount’, ‘UA-XXXXX-X’],
[‘_trackPageLoadTime’],
[‘_trackPageview’]);

(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

The recommended placement for this snippet is right above the closing </head> tag in the header of each page. Alternative methods of placement for the snippet can be found in this Asynchronous Tracking Usage Guide.

Once the tag is properly placed on each page of the site, you should check the status of the account to verify that data is being received. You can check the status by clicking on “Analytics Settings” in the upper left corner of the Google Analytics page, then click the “Edit” link next to the profile for your site. On the Profile Settings page you’ll see a link to “(Check Status ?)” on the top/right side of the content block. In the event that the profile is not yet receiving data, that link should provide you with further information about how to resolve any issues.

Annotations

Using Google Analytics can be an effective way of recognizing when efforts to increase engagement and audience size have worked or failed. Google Analytics offers the ability to attach annotations to individual dates to keep track of any major changes you make to the site. This can be an extremely useful way to track the impact of design changes, content partnerships or the publishing of significant articles or posts.

Insights

The following is a short list of metrics that will be useful to keep track of on a consistent basis when evaluating the effectiveness of your web site:

Traffic Sources > Referrals
https://www.google.com/analytics/reporting/referring_sources
Tracking the changes in volume of traffic from different sources and social media efforts. (i.e. Are more or less people discovering our content from Facebook, Twitter, Google News?)

Content > Content By Title
https://www.google.com/analytics/reporting/content_titles
What were the most consumed articles during a given time?

Visitors > Visitor Loyalty
https://www.google.com/analytics/reporting/loyalty
How devoted is my audience to coming back to the web site and how often?

Content > Content Drilldown > Navigation Summary
https://www.google.com/analytics/reporting/content_detail_navigation
How did visitors find a specific page and where did they go when they left that page?

Visitors > Maps Overlay
https://www.google.com/analytics/reporting/maps
Where are my visitors geographically?

Visitors > Browsers and OS
https://www.google.com/analytics/reporting/os_browsers
What browsers and or mobile devices are my visitors using to read my content?

Please note, these recommendations only scratch the surface of what’s possible with GA. There are many more advanced features, such as Custom VariablesEvent Tracking and Campaign Tracking. For a great list of resources for journalists, check out the New Media Toolkit’s guide to monitoring and metrics.

—————————-