Almost every blogger these days has an eBook available for free download. It would be nice to know how many times that eBook has been downloaded, wouldn't it? Fortunately, Google Analytics provides us with a way.You can create an 'Event'.
Note: Google is slowly migrating from it's classing analytics code (ga.js) to Universal Analytics (analytics.js) To determine which you are using, do a 'Vire Source' on any page in your blog and look for 'ga.js' or analytics.js'.
Event Tracking with ga.js
Google has a page that describes setting up event tracking but here it is in a nutshell:
Let's say you have two ebooks as well as several other items available for download. Right now the dowload link for the first ebook probably looks something like this:
<a href="http://blablabla/ebook1.pdf">Click Here to Download EBook 1</a>
To this, you would add something like:
onclick="_gaq.push(['_trackEvent', 'Downloads', EBooks', 'Book 1']);"
The entire download link then becomes:
<a href="http://blablabla/ebook1.pdf" onclick="_gaq.push(['_trackEvent', 'Downloads', EBooks', 'Book 1']);">Click Here to Download EBook 1</a>
This allows you to:
- Track downloads separately from any other events you might create.
- Track EBook downloads separately from your other downloads
- Seperately track the number of downloads of each ebook.
Event Tracking with analytics.js
Google has a page that describes setting up event tracking but here it is in a nutshell:
Let's say you have two ebooks as well as several other items available for download. Right now the dowload link for the first ebok probably looks somehting like this:
<a href="http://blablabla/ebook1.pdf">Click Here to Download EBook 1</a>
To this, you would add something like:
onClick="ga('send', 'event', 'Downloads', 'Ebooks', 'Book 1');"
The entire download link then becomes:
<a href="http://blablabla/ebook1.pdf" onClick="ga('send', 'event', 'Downloads', 'Ebooks', 'Book 1');">Click Here to Download EBook 1</a>
This allows you to:
- Track downloads separately from any other events you might create.
- Track EBook downloads separately from your other downloads
- Separately track the number of downloads of each ebook.
Viewing Event Metrics in Google Analytics
Log in to your Google Analytics account. Go to Behavior->Events->Top Events to see how many times your ebook has been downloaded.
Recent Comments