Google Analytics and tracking unique downloads

I have a resource page with .pdfs and .ppts
What do I need to do to track if a user clicks on these links?
Is there also an extra step I need to take to track if they successfully downloaded the target completely?

I heard one solution is to make a single sub-web page for each download item and stick an analytics snippet in to the page as one way to track, but this sounds tedious and not very efficient. Is there something that can track this on the fly?

Thanks!

Posted on May 4, 2010 8:40 AM

Reply
52 replies

May 27, 2010 3:45 PM in response to Yoga_D

No more errors, this means I'm officially not tracking unique file extensions anymore, correct?


pageTracker is also set inside my function setupAnchors() - inside the try {} catch (e) {} block.

you can see whether the code is applied correctly using safari activity window, control click your link and open it in new tab or new window, then look at safari activity window...

you should see google echo back with the tracking data, you can copy it and paste into textedit and search for: utmp= that's the tracked url.

May 29, 2010 12:17 PM in response to Cyclosaurus

Cyclosaurus,

An interesting phenomena is occurring. I bring it up in this thread because it feels relevant.
On http://www.energyschool.com/CSES_Home/Links.html if I try to click any of the links immediately the browser 404s. Upon looking at the URL it seems that:
"http://www.energyschool.com/external/" is prefixed before the actual URL. It does not occur if I cmd+click the link (aka open in-congnito tab).
Does this have anything to do with gatag.js script ? (since /external/ links are tracked by the script)

Message was edited by: Yoga_D (for clarity)

May 29, 2010 12:45 PM in response to Cyclosaurus

Here is an example screencast (no sound) of the issue:
http://somaticjourney.com//temp/Broken%20gatag.js.mov

the location was from:
http://www.energyschool.com/CSES_Home/Links.html

I suspect it has something to do with gatag.js:
77 function trackExternalLinks (evnt) {
78
79 var e = (evnt.srcElement) ? evnt.srcElement : this;
80 while (e.tagName != "A") {
81 e = e.parentNode;
82 }
*83 var lnk = (e.pathname.charAt(0) == "/") ? e.pathname : "/" + e.pathname;*
*84 if (e.search && e.pathname.indexOf(e.search) == -1) lnk += e.search;*
*85 if (e.hostname != location.host) lnk = "/external/" + e.hostname + lnk;*
86 if (typeof(pageTracker) == "object") {
87 trackedPage = pageTracker._trackPageview(lnk);
88 // remove href to set up delay time ;
89 e.href = 'javascript:void(0)';
90 // delay opening anchor link ;
91 setTimeout(function () {document.location = lnk}, newURLtimer);


Message was edited by: Yoga_D (added gatag.js code segment)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Google Analytics and tracking unique downloads

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.