: 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>
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.
More posts by @RJPawlick198
1 Comments
Sorted by latest first Latest Oldest Best
Have a look at www.google.com/support/forum/p/Google%20Analytics/thread?tid=16314668d395d15d&hl=en and code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html
Looks like you are using asynchronous tracking but the old way to call _trackPageview
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.