News for hackers. Stuff that matters.
Re:Pixel Tracking in Node.js by latchkey on Friday December 16, 2011 @01:22PM (#3361605)
I wrote the pixel tracker for a big corporation, which tracks a ton of hits for many top sites.

1) Using Math.random() to generate a UUID, is not a UUID. There are plenty of JS uuid generators out there. Please use one. 2) Why are you returning a header with what is being tracked? 3) Please please please use coffeescript.

Re:Pixel Tracking in Node.js by pork on Friday December 16, 2011 @03:07PM (#3362089)
About (1), your uuid is random with a good math.random() and a sufficiently long string with high probability (using that as a technical term from theoretical cs). So I assume that your gripe is that math.random() has bad implementations.

Recall the article recently on how a deck of shuffled cards is unique in human history? Apply same logic.

Re:Pixel Tracking in Node.js by asktell on Friday December 16, 2011 @03:00PM (#3362054)
3) Why use CoffeeScript in this instance? I don't see this being a valid criticism of any JavaScript project, let alone one so trivial. Comma prefixing on the other hand...
Re:Pixel Tracking in Node.js by knowtheory on Friday December 16, 2011 @10:01AM (#3360861)
Neat, it's cool to see pixel tracking as a middleware component.

What i'm not clear on (and i'd love to hear your thoughts about) is why you'd want it as a middleware component vs a daemonized external service such as http://documentcloud.github.com/pixel-ping/ (and if you care about such things, check out the annotated source: http://documentcloud.github.com/pixel-ping/docs/pixel-ping.h... )

full disclosure: i joined DocumentCloud a few months ago.

Re:Pixel Tracking in Node.js by funthree on Friday December 16, 2011 @10:12AM (#3360899)
pixel-tracker works with express out of the box and doesnt really imply that you will want to aggregate hits with a key or any certain way. It just provides information about a request you can use in your app (or separate it)

with pixel-tracker there is no aggregated information, but there is a little more detailed information about each request

Re:Pixel Tracking in Node.js by voidfiles on Friday December 16, 2011 @01:06PM (#3361516)
You can do something like this with mixpanel if you don't want to setup a whole server. I wrote about it.

http://alexkessinger.net/2010/12/17/doing-a-pixel-ping-witho...

Re:Pixel Tracking in Node.js by wingerlang on Friday December 16, 2011 @09:57AM (#3360849)
I've never heard of pixel-tracking before. But Will wont it break if the user caches it? Then It wont be read again and thus not count the view.

Or?

Re:Pixel Tracking in Node.js by funthree on Friday December 16, 2011 @09:59AM (#3360853)
the pixel doesn't get cached
Re:Pixel Tracking in Node.js by grhino on Friday December 16, 2011 @10:53AM (#3361014)
Is that the reason why pixel tracking is used because other requests might be cached? When viewing a page, the browser client may just pull the page from cache and not make a request to the server? A 1x1 gif is small, static, and downloaded asynchronously and makes a negligible impact both client and server side.