Proposal: Add more tracking data to our statistics by running a small JavaScript on the client's computer. This data is fed back to drupal and tracked by user.
I started this project when I was looking at phpmyvisites.
I copied a lot of the JavaScript from that app over and added some stuff for computing the user's connection speed.
The javascript and data collection code seems pretty well finished. The next step is reporting.
I'm providing these patches as a preview version. I would be interested to know what other data people would like to collect. It currenlty collects java, os, screen res ,lang, director, flash, pdf , quicktime ,realplayer , wma, and connection speed.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | connectspeed.jpg | 3.59 KB | mfredrickson |
| #6 | xstatistics.install | 546 bytes | mfredrickson |
| #5 | xstatistics.js.txt | 3.55 KB | mfredrickson |
| #4 | xstatistics.patch | 7.89 KB | mfredrickson |
| #1 | xstatistics.jsreporting.final.tar.gz | 10 KB | mfredrickson |
Comments
Comment #1
mfredrickson commentedOk. I'm calling it done for now. I would appreciate reviews of this code. Attached is a tar.gz with the patch and the new files.
In your review, please understand the goal of this script is to gather information on users that cannot be discovered from PHP requests. If the script captures redundant data or is missing something obvious, please let me know.
Additionally, security is not my strong point. Since I am storing values from an HTTP Get directly into the database, I know I need to check that data. I've used the filter_xss option, but if there is a better method, please suggest it.
Finally, the connection speed stuff is still under development. I need to test it some more. It seems somewhat unreliable in my tests, but I've just uploaded this new version to a production system, so I'll have more data soon.
Thank you.
-Mark
Comment #2
Bèr Kessels commentedplease post real patches, in plan text.
your tarball seems broken and makes reviewing a lot harder then it should be. http://drupal.org/difandpatch
Comment #3
Bèr Kessels commentedComment #4
mfredrickson commentedOk. Attaching the patch to this post. The .js, .jpg, .install files will be in the next 3 posts.
Comment #5
mfredrickson commented.js file
Comment #6
mfredrickson commented.install
Comment #7
mfredrickson commented.jpg file (for testing the connection speed)
Comment #8
mfredrickson commentedComment #9
Bèr Kessels commentedI tested this, and I like it.
However, this introduces a privacy issue too, so I am thinking of some ways to switch this off.
One option is to make it a tiny module, xstatistics_js.module, that depends on xstatistics if you wish, mfredrickson, I will grant you CVS permissions once submitted, so that you can maintain that yourself.
The other option, is to introduce a setting, something like "report user information", so that peopel can switch this on or off.
I prefer the first option... :)
Comment #10
mfredrickson commentedI too prefer the first option. Do you want a contrib directory for xstats, or should this be a separate module in CVS?
Thanks for reviewing,
-Mark
Comment #11
sunThis gets more interesting the more users a site has. So size is a manner. Especially for things returning nothing. Please integrate a PHP Javascript Compressor that site administrators may execute once to compress their xstatistics.js file.
Comment #12
moshe weitzman commentedLooks like this never went in. If it is easy, how about adding this module. Thanks.
Comment #13
Bèr Kessels commentedlet me clarify #9:
The patch in current state enforces everyone with xstatistics to track ALL user data. Many people including myself, may want only partial tracking of the data for several reasons, privacy and overhead being the most obvious reasons.
Therefore I think we should modularise this module: in this case simply make a patch and a module.
The patch would add basic support to xstatistics, the .module would extend that a lot.
Bèr
Comment #14
moshe weitzman commentedAnyone up for picking up this patch, and eventually doing the reporting side?