Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

track users who have javascript enabled/disabled?

tbowman
Minted
Posted on Feb 15, '07 at 09:53 pm

not sure if this is possible..

is there a pepper for displaying how many users have javascript enabled or disabled? I imagine you would need to use the php loader rather than js code for tracking for obvious reasons..

if there isnt one.. this would be a really nice thing to have..

You could probably write a simple php script that could tack on a hit in the MySQL database, but that would defeat the purpose of Mint since it could track any hit.

I’ve thought about this, I know there are a couple readers who view my site, but have javascript off, and was wondering if somehow we could drop in just a “basic” segment of data for that viewer. I know you can’t do things like browser width, etc, but you could most everything else.

Sam Brown
Third-Party Pepper Developer
Posted on Feb 16, '07 at 05:33 am

This would have to be a script created seperately from Mint. Mint uses JavaScript to track visitors thus, no javascript no addition to your Mint stats.

This could more easily be accomplished using a third party script, and if needs be that data could be accessed via a Mint Pepper.

tbowman
Minted
Posted on Feb 16, '07 at 02:51 pm

what about using a combo on the tracking code.. append a argument or small url modification to users who have javascript enabled that would rewrite the link targets to signify javascript was working. If it doesnt make the modification then assume they have it off..

tbowman
Minted
Posted on Feb 16, '07 at 02:56 pm

another idea or variant of the above test would be to replace an img in the html if a user has javascript enabled.. then using some outside parsing mechanism on the logs (similar to how the downloads pepper works to parse the access.log) to look for calls to the img file that only non js users would be calling. you could easily track that and also use the referrer data to tell what page is being loaded..

at least i think this would work..

Well I don’t think it tracking twice would be an issue.

People using PHP wouldn’t use the javascript snipped to track code…

I’m talking replicating what the javascript collects, just directly in PHP.

shokk
Third-Party Pepper Developer
Posted on Feb 17, '07 at 10:05 am

Actually, this might not be too hard. I’m most familiar with PHP, so the way I would do it is to detect whether the user is using Javascript and if not, use curl to call the Mint page. You can even tag “No Javascript” onto the User Agent with curl so that you can track how many of these people are hitting you.

I would rather not replicate anything and let Mint continue to do the work, just using PHP as an assist. The trick is detecting whether Javascript is on with PHP. Everything I’ve says it cannot be done.

ramanan
Minted
Posted on Feb 17, '07 at 01:52 pm

The problem here is you’ll start seeing all the referrer spam that Mint hides. I used to just use Textpattern’s built in logging, but it is all but useless nowadays. If you look at the raw logs for your site, you’ll probably see bajillions of hits from crap referrer spammers.

Yeah, there is a ton of crap, plus you get all the legit bots also.

I guess if you were to add it using PHP, then people will be wanting crawler statistics, etc, not to mention wanting it in their own language…

ifunk
Minted
Posted on Apr 29, '07 at 08:53 am

This is also something I am keen to investigate. I was thinking this could be solved by doing something like this.

<noscript><img src="/nojavascript.php?somerandomstringtopreventcache" alt="" width="0" height="0" /></noscript>

Of course this would require the nojavascript.php script to record a db entry somewhere and would require some php code to generate a random string so it doesn’t cache the fake image. I haven’t really used Mint yet (waiting for my site to go live) so I haven’t written such a script or know how to integrate with Mint, but I thought this might help someone.

You must be logged in to reply. Login above or create an account

Hey there, I have officially suspended sales and support of Mint. The Create Account, Add License, Transfer License, and Contact forms have been disabled. Existing customers may continue to login and download Mint.

More info Continue