Virtual Pageviews for Tracking File Downloads

Contact Us or call 1-877-932-8228
Virtual Pageviews for Tracking File Downloads

Virtual Pageviews for Tracking File Downloads

Google Analytics by default cannot track any file downloads by using standard GATC implementations, since a file download will not trigger a new pageview. Thus, you will need to create a virtual pageview to trick the system to generate a pseudo pageview when someone downloads a file from your website.

For example, if your original link looks like:

<a href="http://www.example.com/GPriceList.pdf">Download a PDF</a>

You need to modify the above link to look like:

<a href="http://www.example.com/report.pdf" onclick="_gaq.push(['_trackPageview', '/vp/downloads/pdf/GlobalPriceList.pdf']);" />Download a PDF</a>

By doing so, you will generate a virtual pageview when someone clicks on the download link. Virtual pageviews are captured in the Top Content and Content Drill Down reports.

Next