WordPress and Tracking Downloads via Google Analytics

Tracking a website’s traffic, one of the many functions that Webmasters will always end of performing (whether they are Guru’s, SEO and Google Analytics Professionals, Web Developers, WordPress Professionals, etc.) for their client. One of the more ‘finer’ tools at their disposal is Google Analytics. SEO Professionals make ‘GOOD’ money knowing the in’s/out’s of Google Analytics. The tools are not just top-notch… they are awesome! 🙂

Now, that does NOT mean that GA Tools are perfect… far from it.

An Example:

I use StatCounter for my own personal use. Reason: I’ve been using StatCounter since its inception… before Google Analytics even existed. It’s FREE and meets my needs. So What? You ask. Well, the FREE version is limited to only the last 500 Page Views… which is fine for me, but does NOT meet the needs on a more professional scale.

So, why this post? StatCounter tracks downloads ‘out-of-the-box’, while Google Analytics does NOT. 🙁 So, we have to perform other operations in order for your Google Analytics to track them… which are usually VERY important to the client.

Tracking your WP Site’s Downloads

[dt_highlight color=”” text_color=”#000000″ bg_color=”#FFFF00″]NOTE: 1) I am assuming this is a WordPress site you own… 2) This ‘tutorial’ is going to assume you HAVE a Google Analytics Account as well. Need help with that? Check this out at Google.[/dt_highlight]

  1. From Google Analytics, retrieve your tracking code: Admin > .JS Tracking Info > Tracking Code.
  2. Copy the Website Tracking code and paste it into the your WP Site’s Header file (header.php) before the PHP call to wp_head.
  3. For Steps 1 & 2… if you have done this already (or through a WP Google Analytics Plugin…) you can skip those first two steps. It will already be inserted by the Plugin.
  4. Insert this missing piece of javascript, to track the downloads:

What to do with the code

  1. Copy/Paste the previous code into the your WP Site’s Header file (header.php) before the PHP call to wp_head. Whether this needs to go BEFORE the Google Analytics code? For me, it has not made a difference. There may be additional JS calls that may hinder this, but as long as your additional JS calls are minimal… I don’t think you are going to have an issue.
  2. To pay due where credit is due, you should pull up the website, http://www.blastam.com/… which does a MUCH better tutorial than I.

So, if you have any further issues, please contact me… or, at the least contact http://www.blastam.com/. 🙂

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.