Project:Xstatistics
Version:master
Component:Code
Category:feature request
Priority:normal
Assigned:mfredrickson
Status:needs work

Issue Summary

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.

AttachmentSize
xstats.patch_and_files.tar.gz40 KB

Comments

#1

Status:needs work» needs review

Ok. 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

AttachmentSize
xstatistics.jsreporting.final.tar.gz 10 KB

#2

please post real patches, in plan text.
your tarball seems broken and makes reviewing a lot harder then it should be. http://drupal.org/difandpatch

#3

Status:needs review» needs work

#4

Ok. Attaching the patch to this post. The .js, .jpg, .install files will be in the next 3 posts.

AttachmentSize
xstatistics.patch 7.89 KB

#5

.js file

AttachmentSize
xstatistics.js.txt 3.55 KB

#6

.install

AttachmentSize
xstatistics.install 546 bytes

#7

.jpg file (for testing the connection speed)

AttachmentSize
connectspeed.jpg 3.59 KB

#8

Status:needs work» needs review

#9

Version:4.7.x-1.x-dev» master
Status:needs review» needs work

I 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... :)

#10

I 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

#11

This 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.

#12

Looks like this never went in. If it is easy, how about adding this module. Thanks.

#13

let 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

#14

Anyone up for picking up this patch, and eventually doing the reporting side?

nobody click here