Angularjs - client browser fingerprint

2.5k views Asked by At

Are there any js plugins for angular based frontend that has a standard way of collecting data for analytics on users based on the browser fingerprinting libraries like fingerprint2.js or clientjs?

1

There are 1 answers

0
Sujit Kumar Singh On BEST ANSWER

I don't think there is a solution for this question in AngularJS or in Angular 2/4.

But I have managed to do this using followings. Any one will work -

  1. clientjs.org
  2. Custom working example

Basically, both ways mentioned above reads localstorage to check if 10 digit number has been stored(with key name) or not. If it has, just use that or else generate new and store it in localstorage.

return checksum([
    navigator.userAgent,
    [screen.height, screen.width, screen.colorDepth].join('x'),
    new Date().getTimezoneOffset(),
    !!window.sessionStorage,
    !!window.localStorage,
    map(navigator.plugins, function (plugin) {
        return [
            plugin.name,
            plugin.description,
            map(plugin, function (mime) {
                return [mime.type, mime.suffixes].join('~');
            }).join(',')
        ].join("::");
    }).join(';')
].join('###'));