Coming soon: external link tracking (and more) in Plone with collective.googleanalytics

Matt Yoder here at Groundwire is brewing up a really nice new feature for his already-excellent Google Analytics integration for Plone, collective.googleanalytics: tracking of external links, file downloads and mailto: links via Google Analytics “event tracking.”

If you’re not already familiar with collective.googleanalytics, that’s OK — it’s still in beta. 🙂  But it’s definitely worth checking out.  Collective.googleanalytics builds on the basic Google Analytics integration capabilities that are built into Plone already.  By taking advantage of Google Analytics’ web services API, collective.googleanalytics pulls selected snippets of your live Google Analytics data back into your Plone site so that site managers get “in their face” analytics data as they are managing content.  We find this really useful with our busy nonprofit clients, who might otherwise not be paying as much attention to their analytics as they ought to.

As we’ve been exploring the intersection of Plone and Google Analytics, we’ve realized that there is a bunch of interesting data that Google Analytics doesn’t automatically capture because they don’t generate full-fledged pageviews for the basic Google Analytics javascript to detect.  For example, “out of the box” Google Analytics doesn’t track PDF or other binary file downloads, people clicking on outbound links, or clicks on non-http links like “mailto:”.  (This isn’t Plone’s fault, it’s a consequence of Google Analytics’ fundamental design architecture.)

However, Google does provide a powerful, flexible (and fairly new) Events Tracking feature that you can call to track interesting non-page-view events like these.    And that’s what Matt is taking advantage of in his upcoming release of collective.googleanalytics to increase the amount of data that Plone sends to Google Analytics.

The collective.googleanalytics control panel has now grown a new set of configuration options:

new google analytics settings

As you can see, you now have the option to enable or disable tracking of email (mailto:) links, external outbound links, and file downloads.  Even better, these extensions are pluggable, so that if your site needs to track more kinds of events, you can easily write small plugins and have them appear in this menu!  Check here for samples of plugins, which should be easy to adapt for your own needs.  Matt would love contributions of additional useful tracking plugins!

Once configured, results will start showing up in Google Analytics under Content>Event Tracking, like so:

collective.googleanalytics is in beta right now; we’re using it on and on a  few of our clients’ sites — to rave reviews thus far.   A “1.0 final” release should come sometime in the next few weeks. Matt’s new work on external link tracking is still in a branch, and will be merged soon.

Bonus points:

  • Matt’s new branch also branch generates the basic Google Analytics tracking javascript for you automatically using the profile you select in the tracking section of the configlet.  (No need to copy-and-paste the javascript snippet from Google anymore, like you do in out-of-the-box Plone.  That’s a nice convenience feature.)
  • All of these new features use the new asynchronous Analytics tracking API, which  should offer some performance benefits over the old blocking javascript, which could sometimes slow down your page loads.

If you’re a Plone developer or integrator, we’d love you to check out, kick the tires and offer feedback.   General comments here are great — we also have a bug tracker on for bug reports or feature requests.