Google Analytics does an awesome job of tracking your web pages/posts, however it does not automatically track file downloads (i.e. PDFs, Excel docs, Word docs, JPGs, etc.).
However, there is a way track downloads using a feature called Event Tracking in Google Analytics.
Why would you ever want to know? Let’s say you are offering a FREE printable and you want to know just how many people downloaded the PDF file or let’s say you are offering an informational handout or a coupon for download in a Sponsored Post and the sponsor wants to know how many people downloaded it. These are just a few reasons you may want to track downloads.
Here is an example to get you started on tracking events a.k.a. downloads.
Creating The Text Link
First you create a simple text link to the file in your page or post. You do this by first uploading the file to your media gallery. Then you highlight the text you want to have linked and add a hyperlink to that file you have just uploaded.
Ex :: <a href=”https://www.citymomsblog.com/freeprintable.pdf”>Download A Free Printable</a>
Adding The Event Tracking Code
Next, we need to add the tracking download code. So you will need to go to your “Text” editing tab. You will need to add the following code after your PDF URL.
Ex :: <a href=”https://www.citymomsblog.com/freeprintable.pdff” onClick=”_gaq.push([‘_trackEvent’, ‘Printable‘, ‘Download‘, ‘Free Printable Offer‘]);”>Download A Free Printable</a>
In the above link, I’ve added an onClick event handler (in bold). This event handler is where you are asking Google Analytics to track clicks on this link as an Event.
Modifying The Event Tracking Code
You can modify the event handler based on the type of download you are wanting to track by Category and Action. This way in Google Analytics you can track events independently.
In the above event handler, ‘Printable’ is the Category designation, ‘Download’ is the Action and ‘Free Printable Offer’ is the Label you are giving this Event. These will appear in your Google Analytic reports.
Google Analytic Reports
Now, you will be able to see these Events by logging into Google Analytics and going to Content > Events in your left column. A few things to note: it can take up to 24 hours to see any new downloads and it won’t back track old downloads only future ones.
That’s it!