Using Javascript from SpiderBasic
SamsonA
 
Posts: 7
Joined: Sat Nov 11, 2017 6:17 am

fingerprintjs2

by SamsonA Mon Sep 24, 2018 7:56 am

Hi,
How can connect a script http://valve.github.io/fingerprintjs2/
SamsonA
 
Posts: 7
Joined: Sat Nov 11, 2017 6:17 am

Re: fingerprintjs2

by SamsonA Mon Sep 24, 2018 12:42 pm

Code: Select all
! var Tracking = {
!  __required_layout_keys: null,
!  __required_interactive_keys: null,
!  __maxQueueSize: null,
!  __timeToSend: null,
!  __initialized: false,
!  initialize: function(config){
!    Tracking.__initialized = true;
!    Tracking.__required_interactive_keys = config.requiredInteractiveKeys;
!    Tracking.__required_layout_keys = config.requiredLayoutKeys;
!    Tracking.__maxQueueSize = config.maxQueueSize;
!    Tracking.__timeToSend = config.timeToSend;
!    Tracking.__bid = '';
!    Tracking.__sid = '';
!    Tracking.__ua = '';
!    // get user data from FingerPrintJs2.
!    // The callback needs to happen after these results are returned:
!    var deferred = $.Deferred(); // create deferred object
!    new Fingerprint2().get(function(result, components){
!          var ua = components.find(function(item){
!            return item.key === "user_agent";
!          });
!          Tracking.__bid = result;
!          Tracking.__sid = result + "." + Date.now();
!          Tracking.__ua = ua.value;
!          deferred.resolve(Tracking); // resolve deferred object with updated Tracking obj
!        });
!    return deferred.promise(); // return deferred promise that we can chain off of
!  },
!  // there are other functions here that return ip, etc.
!};

! var tracker = null;
! $.when(Tracking.initialize({
!  prod: 'OurProduct',
!  requiredLayoutKeys: ["scr"],
!  requiredInteractiveKeys: ["name", "action"],
!  maxQueueSize: 5,
!  timeToSend: 5000,
! })).then(function (updatedTracker) {
!  tracker = updatedTracker;
!  alert(tracker.__bid);
!});


Return to Javascript

Who is online

Users browsing this forum: No registered users and 2 guests