From eaf6a721a56dd49c081175cd15b0d1741ded620f Mon Sep 17 00:00:00 2001 From: "dr.dimitru" Date: Fri, 26 Apr 2019 02:45:01 -0700 Subject: [PATCH] Protocol version bump up --- lib/analytics.js | 2 +- lib/analytics.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/analytics.js b/lib/analytics.js index 204f0e0..a980fa5 100644 --- a/lib/analytics.js +++ b/lib/analytics.js @@ -3,7 +3,7 @@ module.exports = (function () { var self = this; this.sid = sid; this.DNT = !!parseInt(navigator.doNotTrack || 0); - this.version = 115; + this.version = 204; this.sending = false; this.loc = location || window.location || document.location; this.current = ''; diff --git a/lib/analytics.min.js b/lib/analytics.min.js index 151b2fd..71ea12c 100644 --- a/lib/analytics.min.js +++ b/lib/analytics.min.js @@ -1 +1 @@ -window.OstrioTrackerClass=window.OTC=function(){function t(t,n){var i=this;if(this.sid=t,this.DNT=!!parseInt(navigator.doNotTrack||0),this.version=115,this.sending=!1,this.loc=location||window.location||document.location,this.current="",this.auto=!(!1===n),this._euc=encodeURIComponent||function(t){return t},this.info=console.info.bind(console)||console.log.bind(console)||function(){},this.warn=console.warn.bind(console)||console.log.bind(console)||function(){},this.errs=[],this.DNT)return this.info("We respect your decision to be not tracked. DNT policy: https://en.wikipedia.org/wiki/Do_Not_Track"),this.info("For better experience, we recommend to turn off DNT on your browser, more info: https://allaboutdnt.com/#adjust-settings"),this.info("Sincerely, https://ostr.io"),!1;if(this.auto){var o=function(){i.track()};this.on(window,"hashchange",o),this.on(window,"popstate",o),setInterval(function(){i.current===i.loc.href||i.sending||o()},500),this.on(document,"click",function(t){"A"===t.target.nodeName&&o()});var e=window.onerror;window.onerror=function(t,n,o,r){~n.indexOf(i.loc.origin)&&i.pushEvent("[Global Error]","Error: "+t+". File: "+n.replace(i.loc.origin,"")+" At: "+o+":"+r),e&&e.apply(this,arguments)},o()}}return t.prototype.on=function(t,n,i){t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent("on"+n,i)},t.prototype.pushEvent=function(t,n){if(!this.DNT)if(t&&n&&""+t.length&&""+n.length){var i=""+t,o=""+n,e={};if("[Global Error]"===i){if(o=o.trim().substring(0,512),~this.errs.indexOf(o))return;this.errs.push(o)}else o=o.trim().substring(0,64);e[i.trim().substring(0,24)]=o,this.track("?3="+this._euc(JSON.stringify(e)))}else this.warn("[ostrio] [pushEvent]: Can't add event without key or value!")},t.prototype.track=function(t){if(!this.DNT){var n=t||"";if(!this.sending&&this.current!==this.loc.href||~n.indexOf("?3=")){this.sending=!0;var i=this;setTimeout(function(){var t;i.current=i.loc.href,~n.indexOf("?3=")||(n="?6="+i._euc(i.loc.href.trim().substring(0,1024))+n,n+="&2="+i._euc(document.title.trim().substring(0,512)),document.referrer&&!~document.referrer.indexOf(i.loc.origin)&&(n+="&1="+i._euc(document.referrer.trim().substring(0,1024)))),(t=void 0===window.Image?document.createElement("img"):new Image).onload=function(){t=null},t.src="https://analytics.ostr.io/"+i.sid+".gif"+n+"&9="+(""+ +new Date).substr(-7)+"&v="+i.version,i.sending=!1},64)}}},t}(); +window.OstrioTrackerClass=window.OTC=function(){function t(t,n){var i=this;if(this.sid=t,this.DNT=!!parseInt(navigator.doNotTrack||0),this.version=204,this.sending=!1,this.loc=location||window.location||document.location,this.current="",this.auto=!(!1===n),this._euc=encodeURIComponent||function(t){return t},this.info=console.info.bind(console)||console.log.bind(console)||function(){},this.warn=console.warn.bind(console)||console.log.bind(console)||function(){},this.errs=[],this.DNT)return this.info("We respect your decision to be not tracked. DNT policy: https://en.wikipedia.org/wiki/Do_Not_Track"),this.info("For better experience, we recommend to turn off DNT on your browser, more info: https://allaboutdnt.com/#adjust-settings"),this.info("Sincerely, https://ostr.io"),!1;if(this.auto){var o=function(){i.track()};this.on(window,"hashchange",o),this.on(window,"popstate",o),setInterval(function(){i.current===i.loc.href||i.sending||o()},500),this.on(document,"click",function(t){"A"===t.target.nodeName&&o()});var e=window.onerror;window.onerror=function(t,n,o,r){~n.indexOf(i.loc.origin)&&i.pushEvent("[Global Error]","Error: "+t+". File: "+n.replace(i.loc.origin,"")+" At: "+o+":"+r),e&&e.apply(this,arguments)},o()}}return t.prototype.on=function(t,n,i){t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent("on"+n,i)},t.prototype.pushEvent=function(t,n){if(!this.DNT)if(t&&n&&""+t.length&&""+n.length){var i=""+t,o=""+n,e={};if("[Global Error]"===i){if(o=o.trim().substring(0,512),~this.errs.indexOf(o))return;this.errs.push(o)}else o=o.trim().substring(0,64);e[i.trim().substring(0,24)]=o,this.track("?3="+this._euc(JSON.stringify(e)))}else this.warn("[ostrio] [pushEvent]: Can't add event without key or value!")},t.prototype.track=function(t){if(!this.DNT){var n=t||"";if(!this.sending&&this.current!==this.loc.href||~n.indexOf("?3=")){this.sending=!0;var i=this;setTimeout(function(){var t;i.current=i.loc.href,~n.indexOf("?3=")||(n="?6="+i._euc(i.loc.href.trim().substring(0,1024))+n,n+="&2="+i._euc(document.title.trim().substring(0,512)),document.referrer&&!~document.referrer.indexOf(i.loc.origin)&&(n+="&1="+i._euc(document.referrer.trim().substring(0,1024)))),(t=void 0===window.Image?document.createElement("img"):new Image).onload=function(){t=null},t.src="https://analytics.ostr.io/"+i.sid+".gif"+n+"&9="+(""+ +new Date).substr(-7)+"&v="+i.version,i.sending=!1},64)}}},t}();