Friday, May 17, 2024
181
rated 0 times [  188] [ 7]  / answers: 1 / hits: 19237  / 12 Years ago, wed, april 25, 2012, 12:00:00

I need help in configuring the _trackPageview in the Google Analytics. I want to track how many times a file has been downloaded. According to Google Analytics documentation I need to use the following onClick event in the download links.



<a href=http://www.example.com/files/map.pdf 
onClick=javascript: _gaq.push(['_trackPageview', '/downloads/map']);>


But I could not find any information that after adding this, where I can see the download stats for this link? Do I need to configure anything in my Analytics account? Thanks.


More From » google-analytics

 Answers
2

That should work, and you shouldn't need to configure anything in Analytics. You will not see the events appear in the Analytics account immediately. I'd give it 24-48 hours to start showing up.



All clicks should be tracked from when you install the code. It may show up under Top Content, or you could filter visited pages by a partial URL.



Because of the delay inherent to Analytics, it's not uncommon to second-guess yourself when you try a new tracking technique. It's important to follow up and confirm the events are registering.



Edit: More info regarding _trackPageview vs _trackEvent...



_trackPageview: Google Analytics' _trackPageview is a function for use on ga.js tracked sites that allows you to track events on your site that do not generate a pageview.



_trackEvent: Event Tracking is a method available in the ga.js tracking code that you can use to record user interaction with website elements, such as a Flash-driven menu system.



My suggestion is that if you have a number of different downloadable files that you want to track, look into _trackEvent. If you only have one or two files to track, _trackPageview is definitely suitable. My thought is that when you have a larger number of files to track, _trackEvent will let you track by category (file download), action (hyperlink click), and label (map), which may be more useful if you're interested in downloads as a whole.



_trackEvent is also ad hoc in that whatever you code you write should auto-generate the corresponding report items without any configuration in Google Analytics.



More info (above quotes taken from these pages):



_trackPageview: http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55597



_trackEvent: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide


[#85998] Tuesday, April 24, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rossthomasn

Total Points: 122
Total Questions: 78
Total Answers: 105

Location: South Georgia
Member since Sun, Aug 8, 2021
3 Years ago
;