1$(document).ready(function(){ 2 var urlAPIAnalytics = isStagingApiUrl+"/bnz-api/analytics/", 3 currentPlayer = null, 4 trackerId = '', 5 trackerIdTest = ''; 6 dfd = $.Deferred(); 7 8 var locationanalytic = location.href; 9 10 if(locationanalytic.indexOf('pecellele.') > -1 || locationanalytic.indexOf('goldenlele.') > -1 || locationanalytic.indexOf('localhost:8080') > -1){ 11 trackerId = "UA-21796623-2"; 12 } else { 13 trackerId = "UA-21796623-1"; 14 } 15 16 if(locationanalytic.indexOf('goldenlele.') > -1 || locationanalytic.indexOf('localhost:8080') > -1){ 17 trackerIdTest = "UA-21796623-6"; 18 } 19 20 new Fingerprint2().get(function(res, comp){ 21 dfd.resolve(res); 22 }); 23 24 dfd.promise().then(function(deviceId){ 25 $.when(getClientId()).done(function(res){ 26 var clientId = (res.errorCode == 0) ? res.data : ""; 27 28 $.get("/fe-api/player", function(response){ 29 currentPlayer = response; 30 31 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 32 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 33 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 34 })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); 35 36 if(response.hasOwnProperty("userName") && response.userName != ""){ 37 var params = {'userId': 'AnalyticUserNamePrefix_' + response.userName}; 38 39 if(clientId){ 40 params.clientId = clientId; 41 } 42 }else{ 43 var params = "auto"; 44 45 if(clientId){ 46 params = {clientId: clientId}; 47 } 48 } 49 50 ga('create', trackerId, params); 51 ga('send', 'pageview'); 52 53 if(trackerIdTest){ 54 ga('create', trackerIdTest, params, {'name':'NewBonanza88'}); 55 ga('NewBonanza88.send','pageview'); 56 } 57 58 59 // save client id 60 if(clientId == ""){ 61 ga(function(tracker){ 62 $.when(addClientId(tracker.get('clientId'))).done(function(r){}); 63 }); 64 } 65 }); 66 }); 67 68 function getClientId(){ 69 return $.ajax({ 70 url: urlAPIAnalytics + "get", // don't use slash in end of line 71 type: 'post', 72 data:{trackingId:trackerId, deviceFingerPrint:deviceId} 73 }); 74 } 75 76 function addClientId(argClientId){ 77 return $.ajax({ 78 url: urlAPIAnalytics + "add", // don't use slash in end of line 79 type: 'post', 80 data: {trackingId: trackerId, clientId: argClientId, deviceFingerPrint:deviceId} 81 }); 82 } 83 }); 84});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.