Mobile app version of vmapp.org
Login or Join
RJPawlick198

: Finding results from _trackPageview in Google Analytics I have a number of PDFs on my website that I want to track when people click on them. To do that I added this code to each <a>

@RJPawlick198

Posted in: #GoogleAnalytics

I have a number of PDFs on my website that I want to track when people click on them. To do that I added this code to each <a> tag referencing the PDFs,

onclick="pageTracker._trackPageview('/download/nameOfPDF.pdf');


I then made sure the page with these links had my Google Analytics code and that the code was above all of my links (I placed it at the bottom of the <head> section. This exactly what I have (I replaced my URL and Account # though)

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_setDomainName', '.YYYYYYYYYY.com']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>


My issue is that 3 days later, I have 0 page views for the pdf documents in Top Content and the pages are not showing up at all. Is this because I made a mistake with my code placement or is it an issue with where I am looking in Google Analytics?

I do know that I have had over 1000 page views on my site and the PDFs are rather popular so I am sure something isn't working properly.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @RJPawlick198

1 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme