2

For the purposes of a web analytics engine, is there a good JavaScript library for setting/getting a unique identifier for a visitor? I'm aware of evercookie, but that's a bit harsh for my purposes. I don't like the idea of infecting visitors with anything they can't remove if they really want to and evercookie is also heavy in that it can actually slow down a browser.

I simply want to give website owners as accurate a count as possible of their unique visitors. If a website visitor really doesn't want to be tracked that way, that's fine and understandable. They should have the option to not be tracked by disabling cookies or some other mechanism like a setting by the website owner.

Tracking unique visitors by cookies alone seems too unreliable.

at.
  • 50,922
  • 104
  • 292
  • 461
  • 1
    Why are cookies alone not reliable in your opinion? If a user does not want to be tracked cookies are disabled or deleted when the site is left. Otherwise they are in general enabled. So if you want to give the visitor the choice of beeing tracked or not then ip, ua, cookies and etags should be sufficent. – t.niese May 17 '17 at 17:15
  • @t.niese if someone deletes their cookies, doesn't allow them, goes into incognito mode, etc, then I'll be counting each page view or potentially reload as a unique visitor. I would have to know, somehow, that they're turning off my ability to uniquely identify them. Then I can not count those visits as unique visitors. Basically anyone turning off tracking would be counted as 1 big user. What is being tracked by `ua`? – at. May 17 '17 at 18:44
  • 1
    But how do you want to handle the case `[...]They should have the option to not be tracked[...]` except with one big not tracked _group_ or ignoring the data at all? If you use ip and UserAgent as a rough initial indicator and start tracking if visitor accepts cookies then you would respect the visitors decision. – t.niese May 17 '17 at 19:28

1 Answers1

6

Oki so this question is the leading problem right now in the Web Analytics Industry. Still, there is no reliable mechanism that can give you accurate results.

I have tried various options, the most accurate so far is :

Browser Fingerprint:

  • Identifying an individual user by the unique patterns of information visible whenever a computer visits a website.
  • The information collected is quite comprehensive and often includes the browser type and version, operating system and version, screen resolution, supported fonts, plugins, time zone, language and font preferences, and even hardware configurations. These identifiers may seem generic and not at all personally identifying, yet typically only one in several million people have exactly the same specifications as you.

The js file can be found here: https://github.com/Valve/fingerprintjs2


You can also use FB pixel, use its people id to stitch the users across the devices, sessions etc. But that's a big deal and you need massive engineering effort to do the same.


Tushar Gupta
  • 15,504
  • 1
  • 29
  • 47
  • fingerprintjs2 is an interesting library, is something like that more reliable than cookies? The parameters it depends on, like userAgent, change sometimes frequently. Cookies don't change (unless removed or tampered with) and are sometimes synced across the devices. The FB pixel idea sounds great in conjunction with cookies. Facebook allows you to query a visitor's Facebook Id in JavaScript? – at. May 17 '17 at 18:39
  • @at. yes and no...scenario defers ... cookie based tracking has its oown pros and cons and same with the fingerprint. For FB Pixel you need to add the Atlas tag and then you can map the data using the people id, but again its a bit pain. GA and FB do not gel well. you need ur engineers to work it for ya~ – Tushar Gupta May 18 '17 at 04:33