Analytics
1.7K members online now
1.7K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Track PDF clicks when PDF links don't contain ".pdf"

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I need to track PDF clicks/downloads from my site. Many links to PDF files are formatted like this: javascript:HandleLink('cpe_9088_0','CP___PAGEID=10644'). When you click this type of link, it opens the PDF in a new window.

 

I followed the instructions at http://marketing.risdall.com/blog/how-to-track-pdf-page-views-using-google-tag-manager to create a new tag and trigger. Google Analytics now shows me page views where the Click URL contains ".pdf", but it doesn't show me page views where the Click URL is formatted as above -- without a ".pdf".

 

How can I track PDF clicks/downloads for PDF links that are formatted like this: javascript:;HandleLink('cpe_9088_0','CP___PAGEID=10644')?

 

Thank you in advance!

2 Expert replyverified_user

Track PDF clicks when PDF links don't contain ".pdf"

Rising Star
# 2
Rising Star

You need to modify your JavaScript function HandleLink to also push an event to the Data Layer - you then use that as a trigger.  See https://developers.google.com/tag-manager/devguide#events

_________________________________________________________________________
Director of Marketing | Nehmedia | Partner Profile

Track PDF clicks when PDF links don't contain ".pdf"

Top Contributor
# 3
Top Contributor

Alternatively, you can track PDF downloads on the server side

http://juliencoquet.com/en/2013/04/05/track-pdf-downloads-with-google-universal-analytics-no-javascr...

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan