Forum Moderators: DixonJones

Message Too Old, No Replies

GA not tracking links to PDFs

         

annej

8:20 pm on Jul 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It seems like some links aren't tracked by Google Analytics. For example it shows 0 on all links to PDFs and I know many people have used them and I myself have clicked on them now and then to be sure they work.

Is there something I have set wrong or is it that PDF link traffic is just not tracked with GA?

SanDiego Art

10:18 pm on Jul 31, 2008 (gmt 0)

10+ Year Member



If you are using the Old version of GA, then I believe you need to tag all the links pointing to the PDFs with an Onclick event (pagetracker I believe) so GA is called when the document is being called.

Since a PDF doesn't contain the GA javascript code, it won't show up as a page view unless you use teh onclick method.

I think they have improved this if you are using the newer version of the GA code, but I have yet to try it.

Lots of info in the GA help section about this topic.

g1smd

7:53 pm on Aug 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, you need the onclick code in the link that they click on from within your site. From that, it follows that you can't track external visitors going directly to that file from other sites or from SERPs.

From memory, there is a typo in the example code on Google's site. I think there is a rogue space (immediately after the colon) that stops the JavasScript from actually working in some browsers.

annej

1:58 am on Aug 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the help. It doesn't seem to count link clicks to Amazon Books either. I know people are buying them.