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 18, 2010 5:31 AM in response to Cyclosaurus

Cyclosaurus,

Thanks very much for your reply.
Does your process require direct post-editing of the iWeb page and how do your Analytics results look like?
How are the individual d/ls represented?
Do the widget pages (HTML Snippets) get tracked as well?

Wyodor,

I'm glad to see your motivation return and am curious to see your new approach.

Message was edited by: Yoga_D

May 18, 2010 4:44 PM in response to Wyodor

Then the instruction is wrong :


I'm not saying what's wrong and what's right, people can do anything they like.
I just follow google recommendation:
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55521

Important: if your pages include a call to _trackPageview, _setAllowLinker _trackTrans(), your Analytics tracking code must be placed in your HTML code above any of these calls. In these cases the tracking code can be placed anywhere between the opening <body> tag and the JavaScript call.

May 18, 2010 5:11 PM in response to Yoga_D

Does your process require direct post-editing of the iWeb page and how do your Analytics results look like?


I don't do post-editing, everything automagically appear on my page with my widgets.

How are the individual d/ls represented?


I haven't checked google results, but I know it should work.
go here with safari: http://temp.cyclosaurus.com/AccessTracking/Test.html
I put in a delay time, so I can see what google echo back to me.

open safari Activity window (command optiona), look at my page activities; you should see one echo back from google as in: //www.google-analytics.com/__utm.gif.... mark/hilite it

switch back to my Test page, click on one of the links and quickly (you have 5 sec) switch to safari activity window; you'll see one more: www.google-analytics.com/__utm.gif

Do the widget pages (HTML Snippets) get tracked as well?


I don't use html snippet, but no... none of my widgets will be tracked.

May 19, 2010 4:45 AM in response to Cyclosaurus

Cyclosaurus wrote:
Does your process require direct post-editing of the iWeb page and how do your Analytics results look like?


I don't do post-editing, everything automagically appear on my page with my widgets.


Your own widgets? I must of missed you saying that. That changes everything. I'd love to use them myself, are you OK with sharing?

How are the individual d/ls represented?


I haven't checked google results, but I know it should work.


I'd love to check this on Analytics

go here with safari: http://temp.cyclosaurus.com/AccessTracking/Test.html
I put in a delay time, so I can see what google echo back to me.

open safari Activity window (command optiona), look at my page activities; you should see one echo back from google as in: //www.google-analytics.com/__utm.gif.... mark/hilite it

switch back to my Test page, click on one of the links and quickly (you have 5 sec) switch to safari activity window; you'll see one more: www.google-analytics.com/__utm.gif


I confirm I see the echoed response back from google-analytics

Do the widget pages (HTML Snippets) get tracked as well?


I don't use html snippet, but no... none of my widgets will be tracked.

That's awesome. I'd love to confirm that myself. Would you allow that by sharing your widgets?

May 19, 2010 5:39 PM in response to Yoga_D

Your own widgets? I must of missed you saying that. That changes everything. I'd love to use them myself, are you OK with sharing?


sorry, i don't offer my widgets to public.
you can give apple feedback and ask for tools to build iweb widgets.

I'd love to check this on Analytics
... That's awesome. I'd love to confirm that myself. Would you allow that by sharing your widgets?


confirmation of no tracking of widget markup:
User uploaded file

May 21, 2010 5:36 PM in response to Yoga_D

you should be able to get it to work in html snippet, but you'll need my mod gatag.js.

1) go here: http://www.google.com/support/analytics/bin/answer.py?answer=174090
get the code, remove the <script type="text/javascript"> and </script> lines

2) add the following:

trackerCode = "UA-xxxxxxx-x"; // change UA-xxxxxxx-x to your account code;
pageTracker = gat.getTracker(trackerCode); // this set uppageTracker;

3) save as plain text file, name it: analytics.js

4) go to my page: http://temp.cyclosaurus.com/AccessTracking/Test.html
copy the mod gatag.js , my added code ensure the code is properly called.

5) save it as plain text file, and name it: gatag.js

6) use method in this post:
http://discussions.apple.com/message.jspa?messageID=11529094#11529094
to link the two files to your page, you need to keep track where these two files on your server, because the above method uses relative src path.

May 24, 2010 7:45 AM in response to Cyclosaurus

Hey mate,

Thanks for the breakdown.
Here is what Firebug shows me:
User uploaded file

This is what I have in analytics.js
{code}
var _gaq = _gaq || [];
gaq.push(['setAccount', 'UA-6713948-1']);
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);
})();

trackerCode = "UA-6713948-1"; // change UA-xxxxxxx-x to your account code;
pageTracker = gat.getTracker(trackerCode); // this set uppageTracker;

May 24, 2010 5:50 PM in response to Yoga_D

pageTracker = gat.getTracker(trackerCode); // this set uppageTracker;


that because ga.js was not fully linked to your page, it's the nature of doing in async and have little control.
you can remove that line if you like, my added code to gatag.js ensure that ga.js is linked then it'll work on the anchors.

I added an error trap to my mod gatag.js, you can get it here:
http://temp.cyclosaurus.com/AccessTracking/Test.html

May 26, 2010 6:19 AM in response to Cyclosaurus

Testing modified gatag.js (note: needed to manually edit since copy/paste doublespaces between lines). Lo and behold, Firebug reports no errors, they have magically disappeared.
Didn't delete the pagetracker part of the code, either.
Will see how Analytics updates and let you know.

Just an observations, noticed that you reverted back to the HTML snippet that calls the 2 .js files at the end of the <head> (as opposed to the end of the <body>). Found that interesting.

Feeling excited for this to work.

Message was edited by: Yoga_D

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.