Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/ouopente/public_html/wp-content/plugins/wp-quicklatex/wp-quicklatex.php on line 2074

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/ouopente/public_html/wp-content/plugins/wp-quicklatex/wp-quicklatex.php on line 2075

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/ouopente/public_html/wp-content/plugins/wp-quicklatex/wp-quicklatex.php on line 2074

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/ouopente/public_html/wp-content/plugins/wp-quicklatex/wp-quicklatex.php on line 2075Outbound Link Tracking Using Google Analytics | OU Open Textbooks

Outbound Link Tracking Using Google Analytics

Earlier this year when we launched the OER collection and this blog we decided to utilize Google Analytics. We did this with the intention of gaining a sense of which types of OER our patrons seem to be most interested in. Google Analytics offers a simple chunk of javascript that is to be inserted into each webpage of interest. We did this and so far it has yielded data about which of our pages are being viewed the most, how long users stay on each page, and it gives us an idea of where, geographically our users are located. Despite doing all of these things it does not give us data about which of our outbound links are being used. Regrettably, we have been collecting data about how our pages are being used, but none of it is particularly useful to us. Ideally, we would like to know things like whether or not users are interested in OpenStax books, WikiBooks, open courseware, or any other type or brand of OER, but this is functionality that is not offered by using only the basic Google Analytics code.

The most basic Google Analytics configuration is able to yield interesting data such as this:

Between July 22, 2014 and August 22, 2014 the OER collection has received 679 pageviews over 235 sessions that took place in 22 countries.

Although, this is interesting to know, it does not tell us much that we can use to better serve OER.

Earlier this week, we were reminded of how nice it would be to collect this data so I began looking for potential solutions. Embarassingly, it did not take much searching before I found what seemed to be a perfect solution! What I found was that I had completely misunderstood the capabilities of Google Analytics. In fact, I learned that the basic javascript code that Google provides simply enables Analytics on your page and provides only its most basic functionality. The piece of javascript below was written by Ralph Slooten. He has written a wonderful, detailed entry on using Google Analytics to track outbound links where more information on this subject can be found. All that I did to implement the outbound link tracking capabilities of Google Analytics was insert the following javascript directly after the basic Analytics snippit on each page that I wanted to track.

Because our OER collection is built in the form of a LibGuide, I added the standard Google Analytics tracking code and the snippet above to a box that contains the license information for our pages. LibGuides allows the duplication of boxes via linking meaning that adding these scripts to the HTML of only one box cascaded the changes to all other pages already using the license box. This made for a quick implementation and with a few test clicks, we instantly saw results in our Analytics data. Because I only implemented these changes this morning, not much data has been collected; however, we should soon have a useful histogram that shows which links on our pages receive the most clicks. Not only does this suit our needs very well, but I should think that it would be easy for most LibGuides users to implement.