Closed (duplicate)
Project:
Google Analytics
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
5 Dec 2006 at 17:29 UTC
Updated:
19 May 2007 at 08:29 UTC
Jump to comment: Most recent file
Comments
Comment #1
buddaUse JQuery to parse through all the external links. I'm open to patch submissions to enable this.
Comment #2
brmassa commentedGuys,
a created a javascript that does this and track downloads. its required jquery, so its only useful for drupal 5. The patch is over DRUPAL-5--1-dev
also, i used the standard way to add javascript files in Drupal: drupal_add_js. Google Analytics FAQ says that its recommended to add the code just before the
</body>tag because, on slow connections, the content should come before then a "counter". no technical issue involved.regards,
massa
Comment #3
brmassa commentedand the javascript
Comment #4
buddaThanks for the progress on this feature.
However the javascript code only appears to support three filetypes
filetypes = "xls|pdf|doc";Should these filetypes be selectable in the GA admin, or should the code just count any links which match a certain path maybe? Such as any files in
sites/example.com/files/attachments/*?Either way, there needs to be a way to define what filetypes to track - what about people wanting to track download clicks of mp3s/podcasts, videos, or images?
Comment #5
brmassa commentedMike,
you are completelly right! i just did a prototype. further improvements, like selecting what types of files, transforming segmentation in a drupal_add_js call and using http://dean.edwards.name/packer/ to compress the javascript can be also a plus.
regards,
massa
Comment #6
buddaWhat does "transforming segmentation in a drupal_add_js call" mean?
I don't understand what benefit the packing would have on such a small script? Especially if the script is cached once the browser has gotten it.
Comment #7
brmassa commentedMike,
1* Drupal offers a standard way to put javascripts on pages: drupal_add_js. you can include javascript files or variables. The current code includes the Segmentation variable printing a script tag with the variable inside. it can be done using drupal standards
2* javascript code can be compressed up to 75% using this tool. Once its cached, ok. but before this, it can save bandwidth. Since the code isnt big, there is no big deal, but its painless to help.
regards,
massa
Comment #8
brmassa commentedComment #9
brmassa commentedthe compressed javascript
Comment #10
brmassa commentedsome bug fixes
Comment #11
brmassa commentedi discovered a more elegant way.
Comment #12
brmassa commentedoips.. the js also improved
Comment #13
brmassa commentedGuys,
i did a series of tests and its working fine. i just some modifications and the final patch is on issue http://drupal.org/node/142514.
follow there all updates.
best regards,
massa