You are viewing an old revision of this post, from May 31, 2013 @ 01:57:24. See below for differences between this version and the current revision.

Track PDF Downloads With Google Analytics

Taken from here: http://www.cre8ivespark.com/track-pdf-downloads-with-jquery In the past, it has often been an extensive process to track PDF downloads with Google Analytics. Usually, you would need to add event tracking to every PDF file on a website in order to track the number of downloads. Some companies have spent quite a lot of money to organise a custom script or process in order to add tracking to each document download link on their website. However that has all changed now! With the jQuery script below, you can now easily add tracking to every document of your choice. You could track Word docs, PDF docs and more.

The jQuery Script

[js] <pre>    $("a[href$='pdf']").each(function(index) {       pdfLabel = $(this).attr('href');       pdfOnClick = "_gaq.push(['_trackEvent', 'PDF', 'Download', '" + pdfLabel + "']);";       $(this).attr("onClick", pdfOnClick);     });</pre> [/js]

How To Find The Results In Google Analytics

When you login to Google Analytics, you can track the downloads through the event tracker with the following steps:
  • Click on -> Standard Reporting
  • Click on -> Content
  • Click on -> Events
  • Click on -> Overview
  • Click on the event category (i.e. ‘PDF’)
  • Add the following secondary dimension: ‘Event Label

Revisions

  • June 26, 2013 @ 01:26:26 [Current Revision] by PeterLugg
  • May 31, 2013 @ 01:57:24 by PeterLugg
  • May 31, 2013 @ 01:55:01 by PeterLugg

Revision Differences

There are no differences between the May 31, 2013 @ 01:57:24 revision and the current revision. (Maybe only post meta information was changed.)

Tags:

No comments yet.

Leave a Reply