SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Acquiesce's Avatar
    Join Date
    Feb 2007
    Location
    Reading, England
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tracking links to PDFs with Google Analytics

    Hi all - I'm looking for some guidance on tracking links to PDFs via Google Analytics so I can see how many times a PDF has been downloaded.

    I'm currently using Universal Analytics and having looked online I've added the following code to each link which goes to a PDF:

    Code:
    <a href="pdf/online-safety-for-kids-tips-for-parents.pdf" target="_blank" onclick="_gaq.push(['_trackEvent','Download','PDF','online-safety-for-kids-tips-for-parents.pdf']);">Online Safety for Kids  tips for parents</a>
    But none of the clicks are showing in the stats.

    Any ideas where I might be going wrong?

  2. #2
    SitePoint Member
    Join Date
    Apr 2014
    Location
    Newport Beach, CA
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might give this link setup a try.

    <a onclick="_gaq.push(['_trackEvent', 'PDF', 'Download', '/some/pdf/file.pdf']);"" href="/some/pdf/file.pdf">Download this PDF</a>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •