keen-tracking
Advanced tools
Comparing version 2.0.2 to 2.0.7
@@ -9,2 +9,11 @@ <!-- | ||
--> | ||
# AutoTracking - IP addresses | ||
<a name="2.0.3"></a> | ||
**New:** | ||
* Turn off IP collecting with: | ||
`client.initAutoTracking({ | ||
collectIpAddress: false | ||
});` | ||
# Fetch & Promises | ||
@@ -11,0 +20,0 @@ <a name="2.0.2"></a> |
@@ -8,3 +8,3 @@ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=37)}([function(e,t){e.exports=function(e,t,n){var r;if(!e)return 0;if(n=n||e,e instanceof Array){for(r=0;r<e.length;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1}},function(e,t){e.exports=function(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])e[n]=arguments[t][n];return e}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.a=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(36)),o=(i(n(0)),i(n(1)),n(11));function i(e){return e&&e.__esModule?e:{default:e}}r.default.helpers=r.default.helpers||{},r.default.on("client",function(e){e.extensions={events:[],collections:{}},e.queue=(0,o.queue)(),e.queue.on("flush",function(){e.recordDeferredEvents()})}),r.default.prototype.writeKey=function(e){return arguments.length?(this.config.writeKey=e?String(e):null,this):this.config.writeKey},r.default.prototype.referrerPolicy=function(e){return arguments.length?(this.config.referrerPolicy=e?String(e):null,this):this.config.referrerPolicy},r.default.prototype.setGlobalProperties=function(e){if(r.default.log("This method has been deprecated. Check out #extendEvents: https://github.com/keen/keen-tracking.js#extend-events"),e&&"function"==typeof e)return this.config.globalProperties=e,this;this.emit("error","Invalid value for global properties: "+e)},t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomNodePath=function(e){if(!e.nodeName)return"";var t=[];for(;null!=e.parentNode;){for(var n=0,r=0,o=0;o<e.parentNode.childNodes.length;o++){var i=e.parentNode.childNodes[o];i.nodeName==e.nodeName&&(i===e&&(r=n),n++)}e.hasAttribute("id")&&""!=e.id?t.unshift(e.nodeName.toLowerCase()+"#"+e.id):n>1?t.unshift(e.nodeName.toLowerCase()+":eq("+r+")"):t.unshift(e.nodeName.toLowerCase()),e=e.parentNode}return t.slice(1).join(" > ")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowProfile=function(){var e,t,n;if("undefined"==typeof document)return{};e=document.body,t=document.documentElement,n={height:"innerHeight"in window?window.innerHeight:document.documentElement.offsetHeight,width:"innerWidth"in window?window.innerWidth:document.documentElement.offsetWidth,scrollHeight:Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)||null},window.screen&&(n.ratio={height:window.screen.availHeight?parseFloat((window.innerHeight/window.screen.availHeight).toFixed(2)):null,width:window.screen.availWidth?parseFloat((window.innerWidth/window.screen.availWidth).toFixed(2)):null});return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getScreenProfile=function(){var e,t;if("undefined"==typeof window||!window.screen)return{};e=["height","width","colorDepth","pixelDepth","availHeight","availWidth"],t={};for(var n=0;n<e.length;n++)t[e[n]]=window.screen[e[n]]?window.screen[e[n]]:null;return t.orientation={angle:window.screen.orientation?window.screen.orientation.angle:0,type:window.innerWidth>window.innerHeight?"landscape":"portrait"},t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.deepExtend=function e(t){for(var n=1;n<arguments.length;n++)if(t instanceof Array&&arguments[n]instanceof Array)for(var i=0;i<arguments[n].length;i++)t.indexOf(arguments[n][i])<0&&t.push(arguments[n][i]);else for(var s in arguments[n])void 0!==t[s]&&"object"===r(arguments[n][s])&&null!==arguments[n][s]?e(t[s],o(arguments[n][s])):void 0!==arguments[n][s]&&"function"!=typeof arguments[n][s]&&(t[s]=o(arguments[n][s]));return t};function o(e){return JSON.parse(JSON.stringify(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.extendEvent=function(e,t){if(2!==arguments.length||"string"!=typeof e||"object"!==(void 0===t?"undefined":r(t))&&"function"!=typeof t)return void u.call(this,"Incorrect arguments provided to #extendEvent method");return this.extensions.collections[e]=this.extensions.collections[e]||[],this.extensions.collections[e].push(t),this.emit("extendEvent",e,t),this},t.extendEvents=function(e){if(1!==arguments.length||"object"!==(void 0===e?"undefined":r(e))&&"function"!=typeof e)return void u.call(this,"Incorrect arguments provided to #extendEvents method");return this.extensions.events.push(e),this.emit("extendEvents",e),this},t.getExtendedEventBody=function(e,t){t&&t.length>0&&(0,a.default)(t,function(t,n){var r="function"==typeof t?t():t;(0,i.deepExtend)(e,r)});return e};var o,i=n(9),s=n(0),a=(o=s)&&o.__esModule?o:{default:o};function u(e){var t="Event(s) not extended: "+e;this.emit("error",t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=i;var r,o=n(4);function i(){return this instanceof i==!1?new i:(this.capacity=0,this.config={capacity:5e3,interval:15},this.events={},this.interval=0,this.timer=null,this)}(0,((r=o)&&r.__esModule?r:{default:r}).default)(i.prototype),i.prototype.check=function(){return function(e){if(e.capacity>0&&e.interval>=e.config.interval)return!0;if(e.capacity>=e.config.capacity)return!0;return!1}(this)&&this.flush(),0!==this.config.interval&&0!==this.capacity||this.pause(),this},i.prototype.flush=function(){return this.emit("flush"),this.interval=0,this},i.prototype.pause=function(){return this.timer&&(clearInterval(this.timer),this.timer=null),this},i.prototype.start=function(){var e=this;return e.pause(),e.timer=setInterval(function(){e.interval++,e.check()},1e3),e}},function(e,t,n){"use strict";(function(e){var r=n(3),o=setTimeout;function i(){}function s(e){if(!(this instanceof s))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,s._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void c(t.promise,e)}u(t.promise,r)}else(1===e._state?u:c)(t.promise,e._value)})):e._deferreds.push(t)}function u(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof s)return e._state=3,e._value=t,void l(e);if("function"==typeof n)return void f((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,l(e)}catch(t){c(e,t)}var r,o}function c(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&s._immediateFn(function(){e._handled||s._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function f(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}s.prototype.catch=function(e){return this.then(null,e)},s.prototype.then=function(e,t){var n=new this.constructor(i);return a(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},s.prototype.finally=r.a,s.all=function(e){return new s(function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){i(e,t)},n)}r[e]=s,0==--o&&t(r)}catch(e){n(e)}}for(var s=0;s<r.length;s++)i(s,r[s])})},s.resolve=function(e){return e&&"object"==typeof e&&e.constructor===s?e:new s(function(t){t(e)})},s.reject=function(e){return new s(function(t,n){n(e)})},s.race=function(e){return new s(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},s._immediateFn="function"==typeof e&&function(t){e(t)}||function(e){o(e,0)},s._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t.a=s}).call(this,n(30).setImmediate)},function(e,t,n){"use strict";function r(e){return this instanceof r==!1?new r(e):(this.count=e||0,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.timer=r,r.prototype.start=function(){var e=this;return this.pause(),this.interval=setInterval(function(){e.count++},1e3),this},r.prototype.pause=function(){return clearInterval(this.interval),this},r.prototype.value=function(){return this.count},r.prototype.clear=function(){return this.count=0,this}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.serializeForm=function(e,t){"object"!=(void 0===t?"undefined":r(t))?t={hash:!!t}:void 0===t.hash&&(t.hash=!0);for(var n=t.hash?{}:"",s=t.serializer||(t.hash?a:u),c=e&&e.elements?e.elements:[],l=Object.create(null),f=0;f<c.length;++f){var d=c[f];if(!(t.ignoreTypes&&t.ignoreTypes.indexOf(d.type)>-1)&&((t.disabled||!d.disabled)&&d.name&&i.test(d.nodeName)&&!o.test(d.type))){var p=d.name,h=d.value;if("checkbox"!==d.type&&"radio"!==d.type||d.checked||(h=void 0),t.empty){if("checkbox"!==d.type||d.checked||(h=""),"radio"===d.type&&(l[d.name]||d.checked?d.checked&&(l[d.name]=!0):l[d.name]=!1),void 0==h&&"radio"==d.type)continue}else if(!h)continue;if("select-multiple"!==d.type)n=s(n,p,h);else{h=[];for(var m=d.options,y=!1,v=0;v<m.length;++v){var g=m[v],b=t.empty&&!g.value,w=g.value||b;g.selected&&w&&(y=!0,n=t.hash&&"[]"!==p.slice(p.length-2)?s(n,p+"[]",g.value):s(n,p,g.value))}!y&&t.empty&&(n=s(n,p,""))}}}if(t.empty)for(var p in l)l[p]||(n=s(n,p,""));return n};var o=/^(?:submit|button|image|reset|file)$/i,i=/^(?:input|select|textarea|keygen)/i,s=/(\[[^\[\]]*\])/g;function a(e,t,n){if(t.match(s)){!function e(t,n,r){if(0===n.length)return t=r;var o=n.shift(),i=o.match(/^\[(.+?)\]$/);if("[]"===o)return t=t||[],Array.isArray(t)?t.push(e(null,n,r)):(t._values=t._values||[],t._values.push(e(null,n,r))),t;if(i){var s=i[1],a=+s;isNaN(a)?(t=t||{})[s]=e(t[s],n,r):(t=t||[])[a]=e(t[a],n,r)}else t[o]=e(t[o],n,r);return t}(e,function(e){var t=[],n=new RegExp(s),r=/^([^\[\]]*)/.exec(e);for(r[1]&&t.push(r[1]);null!==(r=n.exec(e));)t.push(r[1]);return t}(t),n)}else{var r=e[t];r?(Array.isArray(r)||(e[t]=[r]),e[t].push(n)):e[t]=n}return e}function u(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}},function(e,t,n){var r,o; | ||
* Released under the MIT license | ||
*/void 0===(o="function"==typeof(r=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}return function t(n){function r(t,o,i){var s;if(arguments.length>1){if("number"==typeof(i=e({path:"/"},r.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}try{s=JSON.stringify(o),/^[\{\[]/.test(s)&&(o=s)}catch(e){}return o=n.write?n.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",o,i.expires&&"; expires="+i.expires.toUTCString(),i.path&&"; path="+i.path,i.domain&&"; domain="+i.domain,i.secure?"; secure":""].join("")}t||(s={});for(var u=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l<u.length;l++){var f=u[l].split("="),d=f[0].replace(c,decodeURIComponent),p=f.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{if(p=n.read?n.read(p,d):n(p,d)||p.replace(c,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(e){}if(t===d){s=p;break}t||(s[d]=p)}catch(e){}}return s}return r.get=r.set=r,r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}(function(){})})?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cookie=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=s(n(15)),i=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}var a=t.cookie=function e(t){if(arguments.length)return this instanceof e==!1?new e(t):(this.config={key:t,options:{expires:365}},this.data=this.get(),this)};a.prototype.get=function(e){var t={};return o.default.get(this.config.key)&&(t=o.default.getJSON(this.config.key)),e&&"object"===(void 0===t?"undefined":r(t))&&null!==typeof t?void 0!==t[e]?t[e]:null:t},a.prototype.set=function(e,t,n){return arguments.length&&this.enabled()?("string"==typeof e&&arguments.length>=2?this.data[e]=t||null:"object"===(void 0===e?"undefined":r(e))&&1===arguments.length&&(0,i.default)(this.data,e),o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,n||{})),this):this},a.prototype.expire=function(e){return e?o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,{expires:e})):(o.default.remove(this.config.key),this.data={}),this},a.prototype.options=function(e){return arguments.length?(this.config.options="object"===(void 0===e?"undefined":r(e))?e:{},this):this.config.options},a.prototype.enabled=function(){return navigator.cookieEnabled}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"==e?t:3&t|8;return n.toString(16)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getScrollState=function(e){var t="object"===(void 0===e?"undefined":r(e))?e:{},n=(0,s.default)({pixel:0,pixel_max:0,ratio:null,ratio_max:null},t);void 0===("undefined"==typeof window?"undefined":r(window))&&void 0===("undefined"==typeof document?"undefined":r(document))||(n.pixel=(void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)+(window.innerHeight||document.documentElement.clientHeight),n.pixel>n.pixel_max&&(n.pixel_max=n.pixel),n.ratio=parseFloat(Number(n.pixel/a()).toFixed(2)),n.ratio_max=parseFloat(Number(n.pixel_max/a()).toFixed(2)));return n};var o,i=n(1),s=(o=i)&&o.__esModule?o:{default:o};function a(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)||null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomNodeProfile=function(e){return{action:e.action,class:e.className,href:e.href||null,id:e.id,method:e.method,name:e.name,node_name:e.nodeName,selector:(0,r.getDomNodePath)(e),text:e.text,title:e.title,type:e.type,x_position:e.offsetLeft||e.clientLeft||null,y_position:e.offsetTop||e.clientTop||null}};var r=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainName=function(e){var t=function(e){var t;t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t=(t=t.split(":")[0]).split("?")[0]}(e),n=t.split("."),r=n.length;r>2&&(t=n[r-2]+"."+n[r-1],2==n[r-2].length&&2==n[r-1].length&&(t=n[r-3]+"."+t));return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDatetimeIndex=function(e){var t=e||new Date;return{hour_of_day:t.getHours(),day_of_week:parseInt(1+t.getDay()),day_of_month:t.getDate(),month:parseInt(1+t.getMonth()),year:t.getFullYear()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowserProfile=function(){return{cookies:void 0!==navigator.cookieEnabled&&navigator.cookieEnabled,codeName:navigator.appCodeName,description:function(){var e;document&&"function"==typeof document.querySelector&&(e=document.querySelector('meta[name="description"]'));return e?e.content:""}(),language:navigator.language,name:navigator.appName,online:navigator.onLine,platform:navigator.platform,useragent:navigator.userAgent,version:navigator.appVersion,screen:(0,r.getScreenProfile)(),window:(0,o.getWindowProfile)()}};var r=n(8),o=n(7)},function(e){e.exports={name:"keen-tracking",version:"2.0.1",description:"Data Collection SDK for Keen IO",main:"dist/node/keen-tracking.js",browser:"dist/keen-tracking.js",repository:{type:"git",url:"https://github.com/keen/keen-tracking.js.git"},scripts:{start:"NODE_ENV=development webpack-dev-server",test:"NODE_ENV=test jest && NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch",build:"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p",profile:"webpack --profile --json > stats.json",analyze:"webpack-bundle-analyzer stats.json /dist",preversion:"npm run build && npm run test",version:"git add .",postversion:"git push && git push --tags",demo:"node ./test/demo/index.node.js"},bugs:"https://github.com/keen/keen-tracking.js/issues",author:"Keen IO <team@keen.io> (https://keen.io/)",contributors:["Dustin Larimer <dustin@keen.io> (https://github.com/dustinlarimer)","Eric Anderson <eric@keen.io> (https://github.com/aroc)","Joe Wegner <joe@keen.io> (http://www.wegnerdesign.com)","Alex Kleissner <alex@keen.io> (https://github.com/hex337)","Adam Kasprowicz <adam.kasprowicz@keen.io> (https://github.com/adamkasprowicz)"],license:"MIT",dependencies:{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},devDependencies:{"babel-jest":"^23.0.1","babel-loader":"^7.1.4","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.7.0",eslint:"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3",gulp:"^3.8.11","gulp-awspublish":"0.0.23","gulp-rename":"^1.2.2","gulp-replace":"^0.5.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0",jest:"^22.4.3",nock:"^9.2.6","regenerator-runtime":"^0.11.1",webpack:"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initAutoTrackingCore=function(e){return function(t){var n=this,r=e.helpers,o=e.utils,s=o.extend({ignoreDisabledFormFields:!1,ignoreFormFieldTypes:["password"],recordClicks:!0,recordFormSubmits:!0,recordPageViews:!0,recordScrollState:!0,shareUuidAcrossDomains:!1},t),a=new Date,u=new o.cookie("keen"),c=u.get("uuid");if(!c){c=r.getUniqueId();var l=r.getDomainName(window.location.hostname),f=l&&s.shareUuidAcrossDomains?{domain:"."+l}:{};u.set("uuid",c,f)}var d={};return s.recordScrollState&&(d=r.getScrollState(),o.listener("window").on("scroll",function(){d=r.getScrollState(d)})),n.extendEvents(function(){var e,t,n=r.getBrowserProfile();return{tracked_by:i.default.name+"-"+i.default.version,local_time_full:(new Date).toISOString(),user:{uuid:c},page:{title:document?document.title:null,description:n.description,time_on_page:(e=a,t=(new Date).getTime()-e.getTime(),Math.round(t/1e3))},ip_address:"${keen.ip}",geo:{},user_agent:"${keen.user_agent}",tech:{profile:n},url:{full:window?window.location.href:"",info:{}},referrer:{full:document?document.referrer:"",info:{}},time:{local:{},utc:{}},keen:{timestamp:(new Date).toISOString(),addons:[{name:"keen:ip_to_geo",input:{ip:"ip_address"},output:"geo"},{name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"tech"},{name:"keen:url_parser",input:{url:"url.full"},output:"url.info"},{name:"keen:url_parser",input:{url:"referrer.full"},output:"referrer.info"},{name:"keen:date_time_parser",input:{date_time:"keen.timestamp"},output:"time.utc"},{name:"keen:date_time_parser",input:{date_time:"local_time_full"},output:"time.local"}]}}}),!0===s.recordClicks&&o.listener("a, a *").on("click",function(e){var t=e.target,o={element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString(),page:{scroll_state:d}};return n.recordEvent("clicks",o)}),!0===s.recordFormSubmits&&o.listener("form").on("submit",function(e){var t=e.target,i={disabled:s.ignoreDisabledFormFields,ignoreTypes:s.ignoreFormFieldTypes},a={form:{action:t.action,fields:o.serializeForm(t,i),method:t.method},element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString(),page:{scroll_state:d}};return n.recordEvent("form_submissions",a)}),!0===s.recordPageViews&&n.recordEvent("pageviews"),n}};var r,o=n(23),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.deferEvent=function(e,t){if(2!==arguments.length||"string"!=typeof e)return void a.call(this,"Incorrect arguments provided to #deferEvent method");this.queue.events[e]=this.queue.events[e]||[],this.queue.events[e].push(t),this.queue.capacity++,this.queue.timer||this.queue.start();return this.emit("deferEvent",e,t),this},t.deferEvents=function(e){var t=this;if(1!==arguments.length||"object"!==(void 0===e?"undefined":r(e)))return void a.call(this,"Incorrect arguments provided to #deferEvents method");return(0,o.default)(e,function(e,n){t.queue.events[n]=t.queue.events[n]||[],t.queue.events[n]=t.queue.events[n].concat(e),t.queue.capacity=t.queue.capacity+e.length,t.queue.timer||t.queue.start()}),t.emit("deferEvents",e),t},t.queueCapacity=function(e){return arguments.length?(this.queue.config.capacity=e?Number(e):0,this.queue.check(),this):this.queue.config.capacity},t.queueInterval=function(e){return arguments.length?(this.queue.config.interval=e?Number(e):0,this.queue.check(),this):this.queue.config.interval},t.recordDeferredEvents=function(){var e,t,n=this;n.queue.capacity>0&&(n.queue.pause(),e=JSON.parse(JSON.stringify(n.queue.config)),t=JSON.parse(JSON.stringify(n.queue.events)),n.queue=(0,i.queue)(),n.queue.config=e,n.queue.on("flush",function(){n.recordDeferredEvents()}),n.emit("recordDeferredEvents",t),n.recordEvents(t,function(e,r){e?n.recordEvents(t):t=void 0}));return n};s(n(5));var o=s(n(0)),i=n(11);function s(e){return e&&e.__esModule?e:{default:e}}function a(e){var t="Event(s) not deferred: "+e;this.emit("error",t)}},function(e,t){e.exports={map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){"use strict";var t,n,r,o,i,s,a,u="",c=0,l=this.map;for(e=this.utf8.encode(e);c<e.length;)t=e.charCodeAt(c++),n=e.charCodeAt(c++),r=e.charCodeAt(c++),o=t>>2,i=(3&t)<<4|n>>4,s=isNaN(n)?64:(15&n)<<2|r>>6,a=isNaN(n)||isNaN(r)?64:63&r,u=u+l.charAt(o)+l.charAt(i)+l.charAt(s)+l.charAt(a);return u},decode:function(e){"use strict";var t,n,r,o,i,s,a="",u=0,c=this.map,l=String.fromCharCode;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=c.indexOf(e.charAt(u++)),i=(15&(n=c.indexOf(e.charAt(u++))))<<4|(r=c.indexOf(e.charAt(u++)))>>2,s=(3&r)<<6|(o=c.indexOf(e.charAt(u++))),a=a+(l(t<<2|n>>4)+(64!=r?l(i):""))+(64!=o?l(s):"");return this.utf8.decode(a)},utf8:{encode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r<e.length;)n+=(t=e.charCodeAt(r++))<128?o(t):t>127&&t<2048?o(t>>6|192)+o(63&t|128):o(t>>12|224)+o(t>>6&63|128)+o(63&t|128);return n},decode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r<e.length;)n+=(t=e.charCodeAt(r))<128?[o(t),r++][0]:t>191&&t<224?[o((31&t)<<6|63&e.charCodeAt(r+1)),r+=2][0]:[o((15&t)<<12|(63&e.charCodeAt(r+1))<<6|63&(c3=e.charCodeAt(r+2))),r+=3][0];return n}}}},function(e,t){!function(e){"use strict";if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};l.prototype.append=function(e,t){e=a(e),t=u(t);var n=this.map[e];this.map[e]=n?n+","+t:t},l.prototype.delete=function(e){delete this.map[a(e)]},l.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},l.prototype.set=function(e,t){this.map[a(e)]=u(t)},l.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),c(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),c(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),c(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var i=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},m.call(y.prototype),m.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var s=[301,302,303,307,308];g.redirect=function(e,t){if(-1===s.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.Headers=l,e.Request=y,e.Response=g,e.fetch=function(e,n){return new Promise(function(r,o){var i=new y(e,n),s=new XMLHttpRequest;s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new g(o,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&t.blob&&(s.responseType="blob"),i.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&r(e))this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,r=f(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=d(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e,t){var n,r,o=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),i.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,s,a,u=1,c={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},d.clearImmediate=p}function p(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(2),n(28))},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(29),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){"use strict";n.r(t),function(e){var t=n(12),r=n(3),o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}();o.Promise?o.Promise.prototype.finally||(o.Promise.prototype.finally=r.a):o.Promise=t.a}.call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.recordEvent=l,t.recordEvents=f,t.addEvent=function(){console.log("addEvent method is depracated. Check out #recordEvent: https://github.com/keen/keen-tracking.js#record-a-single-event"),this.emit("error","This method has been deprecated. Check out #recordEvent: https://github.com/keen/keen-tracking.js#record-a-single-event"),l.apply(this,arguments)},t.addEvents=function(){console.log("addEvents method is depracated. Check out #recordEvents: https://github.com/keen/keen-tracking.js#record-multiple-events"),this.emit("error","This method has been deprecated. Check out #recordEvents: https://github.com/keen/keen-tracking.js#record-multiple-events"),f.apply(this,arguments)},n(31),n(27);var o=c(n(5)),i=c(n(26)),s=c(n(0)),a=c(n(1)),u=n(10);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n,r){var s,c,l,f,g,b,w;if(s=this.url("events",encodeURIComponent(e)),c={},l=n,w="boolean"!=typeof r||r,d.call(this,l)){if(e&&"string"==typeof e){if(this.config.globalProperties&&(console.log("config.globalProperties are deprecated"),c=this.config.globalProperties(e)),(0,a.default)(c,t),b={},(0,u.getExtendedEventBody)(b,this.extensions.events),(0,u.getExtendedEventBody)(b,this.extensions.collections[e]),(0,u.getExtendedEventBody)(b,[c]),this.emit("recordEvent",e,b),!o.default.enabled)return p.call(this,"Keen.enabled is set to false.",l),!1;if(g=(f=this.url("events",encodeURIComponent(e),{api_key:this.writeKey(),data:encodeURIComponent(i.default.encode(JSON.stringify(b))),modified:(new Date).getTime()})).length<function(){if("undefined"!=typeof window&&navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0))return 1900;return 16e3}(),w)switch(this.config.requestType){case"xhr":y.call(this,"POST",s,b,l);break;case"beacon":g?function(e,t){var n=this,r=t,o=document.createElement("img");t=null,o.onload=function(){if(!0,"naturalHeight"in this){if(this.naturalHeight+this.naturalWidth===0)return void this.onerror()}else if(this.width+this.height===0)return void this.onerror();r&&r.call(n)},o.onerror=function(){!0,r&&r.call(n,"An error occurred!",null)},o.src=e+"&c=clv1"}.call(this,f,l):h.call(this,s,b,"Beacon URL length exceeds current browser limit, and XHR is not supported.",l);break;default:if("undefined"!=typeof fetch)return m.call(this,"POST",s,b,l);g?function(e,t){var n=this,r=t,o=(new Date).getTime(),i=document.createElement("script"),s=document.getElementsByTagName("head")[0],a="keenJSONPCallback",u=!1;t=null,a+=o;for(;a in window;)a+="a";function c(){r&&r.call(n,"An error occurred!",null)}function l(){window[a]=void 0;try{delete window[a]}catch(e){}s.removeChild(i)}window[a]=function(e){!0!==u&&(u=!0,r&&r.call(n,null,e),l())},i.src=e+"&jsonp="+a,s.appendChild(i),i.onreadystatechange=function(){!1===u&&"loaded"===this.readyState&&(u=!0,c(),l())},i.onerror=function(){!1===u&&(u=!0,c(),l())}}.call(this,f,l):h.call(this,s,b,"JSONp URL length exceeds current browser limit, and XHR is not supported.",l)}else g&&function(e){var t=v();t&&(t.open("GET",e,!1),t.send(null))}(f);return n=l=null,this}p.call(this,"Collection name must be a string.",l)}}function f(e,t){var n,i,c,l=this;if(n=this.url("events"),i=t,t=null,d.call(this,i))if("object"!==(void 0===e?"undefined":r(e))||e instanceof Array)p.call(this,"First argument must be an object",i);else{if(!(arguments.length>2))return this.config.globalProperties&&(console.log("config.globalProperties are deprecated"),(0,s.default)(e,function(t,n){(0,s.default)(t,function(t,r){var o=l.config.globalProperties(n);e[n][r]=(0,a.default)(o,t)})})),c={},(0,s.default)(e,function(e,t){c[t]=c[t]||[],(0,s.default)(e,function(e,n){var r={};(0,u.getExtendedEventBody)(r,l.extensions.events),(0,u.getExtendedEventBody)(r,l.extensions.collections[t]),(0,u.getExtendedEventBody)(r,[e]),c[t].push(r)})}),this.emit("recordEvents",c),o.default.enabled?this.config.requestType&&"xhr"===this.config.requestType||"undefined"==typeof fetch?(v()&&y.call(this,"POST",n,c,i),t=i=null,this):m.call(this,"POST",n,c,i):(p.call(this,"Keen.enabled is set to false.",i),!1);p.call(this,"Incorrect arguments provided to #recordEvents method",i)}}function d(e){var t=e;return e=null,this.projectId()?!!this.writeKey()||(p.call(this,"Keen.Client is missing a writeKey property.",t),!1):(p.call(this,"Keen.Client is missing a projectId property.",t),!1)}function p(e,t){var n="Event(s) not recorded: "+e;this.emit("error",n),t&&(t.call(this,n,null),t=null)}function h(e,t,n,r){v()?y.call(this,"POST",e,t,r):p.call(this,n)}function m(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=this;return fetch(t,{method:e,body:n?JSON.stringify(n):"",mode:"cors",redirect:"follow",referrerPolicy:o.referrerPolicy()||"unsafe-url",headers:{Authorization:o.writeKey(),"Content-Type":"application/json"}}).then(function(e){return e.ok?e.json():e.json().then(function(t){return Promise.reject({error_code:t.error_code,body:t.message,status:e.status,ok:!1,statusText:e.statusText})})}).then(function(e){return function(e){if(void 0!==e.created)return!!e.created;if(0===Object.keys(e).map(function(t){return e[t].filter(function(e){return!e.success})}).filter(function(e){return e.length>0}).length)return!0;return!1}(e)?(void 0!==r&&r.call(o,null,e),Promise.resolve(e)):(void 0!==r&&r.call(o,e,null),Promise.reject(e))})}function y(e,t,n,r){var i,s=this,a=v(),u=r;r=null,a.onreadystatechange=function(){var e;if(4==a.readyState)if(a.status>=200&&a.status<300){try{e=JSON.parse(a.responseText)}catch(e){o.default.emit("error","Could not parse HTTP response: "+a.responseText),u&&u.call(s,a,null)}u&&e&&u.call(s,null,e)}else o.default.emit("error","HTTP request failed."),u&&u.call(s,a,null)},a.open(e,t,!0),a.setRequestHeader("Authorization",s.writeKey()),a.setRequestHeader("Content-Type","application/json"),n&&(i=JSON.stringify(n)),"GET"===e.toUpperCase()&&a.send(),"POST"===e.toUpperCase()&&a.send(i)}function v(){var e="undefined"==typeof window?this:window;if(e.XMLHttpRequest&&("file:"!=e.location.protocol||!e.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listenerCore=void 0;o(n(4));var r=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}t.listenerCore=function(e){function t(e){if(e)return this instanceof t==!1?new t(e):(this.selector=e,this)}return e.domListeners=e.domListeners||{},t.prototype.on=function(t,n){var o;return 2!==arguments.length||"string"!=typeof t||"function"!=typeof n?this:(void 0===e.domListeners[t]&&(!function(e,t){document.addEventListener?document.addEventListener(e,t,!1):document.attachEvent("on"+e,t)}(t,(o=t,function(t){var n,i;n=t||window.event,i=n.target||n.srcElement,"undefined"!==e.domListeners[o]&&(0,r.default)(e.domListeners[o],function(e,t){!function(e,t){for(var n=(e.parentNode||document).querySelectorAll(t)||[],r=n.length;r--;)if(n[r]==e)return!0;return!1}(i,t)?"window"===t&&(0,r.default)(e,function(e,t){e(n)}):(0,r.default)(e,function(e,t){"click"===o&&"A"===i.nodeName?function(e,t,n){var r,o;if(void 0!==t.getAttribute?r=t.getAttribute("target"):t.target&&(r=t.target),"boolean"==typeof(o=n(e))&&!1===o||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;"_blank"===r||"blank"===r||e.metaKey||t.hasAttribute("download")||(e.preventDefault&&e.preventDefault(),e.returnValue=!1,t.href&&"#"!==t.href&&t.href!==window.location+"#"&&(void 0!==o&&o.then?o.then(function(){window.location=t.href}).catch(function(e){window.location=t.href}):setTimeout(function(){window.location=t.href},500)))}(n,i,e):"submit"===o&&"FORM"===i.nodeName?function(e,t,n){var r=n(e);if("boolean"==typeof r&&!1===r||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;e.preventDefault&&e.preventDefault(),e.returnValue=!1,void 0!==r&&r.then?r.then(function(){t.submit()}).catch(function(e){t.submit()}):setTimeout(function(){t.submit()},500)}(n,i,e):e(n)})})})),e.domListeners[t]={}),e.domListeners[t][this.selector]=e.domListeners[t][this.selector]||[],e.domListeners[t][this.selector].push(n),this)},t.prototype.once=function(e,t){var n=this;function r(){return n.off(e,r),t.apply(n,arguments)}return r.fn=t,n.on(e,r),n},t.prototype.off=function(t,n){var o=this,i=[];if(2===arguments.length)(0,r.default)(e.domListeners[t][o.selector],function(e,t){e!==n&&e.fn!==n&&i.push(e)}),e.domListeners[t][o.selector]=i;else if(1===arguments.length)try{delete e.domListeners[t][o.selector]}catch(n){e.domListeners[t][o.selector]=[]}else(0,r.default)(e.domListeners,function(t,n){try{delete e.domListeners[n][o.selector]}catch(t){e.domListeners[n][o.selector]=function(){}}});return o},t}},function(e,t,n){var r=n(0);n(1);e.exports=function(e){var t=[];return r(e,function(e,n){"string"!=typeof e&&(e=JSON.stringify(e)),t.push(n+"="+encodeURIComponent(e))}),t.join("&")}},function(e,t){e.exports=function(e){var t,n={},r=/\+/g,o=/([^&=]+)=?([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(r," "))},s=e.split("?")[1];for(;t=o.exec(s);)n[i(t[1])]=i(t[2]);return n}},function(e,t,n){(function(t){(function(t){var r=t.Keen||void 0,o=n(0),i=n(1),s=n(35),a=n(34),u=n(4);function c(e){if(this instanceof c==!1)return new c(e);this.configure(e),c.debug&&this.on("error",c.log),this.emit("ready"),c.emit("client",this)}function l(e){return void 0!==e}r&&void 0===r.resources&&(c.legacyVersion=r),u(c),u(c.prototype),i(c,{debug:!1,enabled:!0,loaded:!1,version:"__VERSION__"}),c.helpers=c.helpers||{},c.resources=c.resources||{},i(c.resources,{base:"{protocol}://{host}",version:"{protocol}://{host}/3.0",projects:"{protocol}://{host}/3.0/projects",projectId:"{protocol}://{host}/3.0/projects/{projectId}",events:"{protocol}://{host}/3.0/projects/{projectId}/events",queries:"{protocol}://{host}/3.0/projects/{projectId}/queries"}),c.utils=c.utils||{},i(c.utils,{each:o,extend:i,parseParams:s,serialize:a}),c.extendLibrary=function(e,t){var n=r||t;return l(n)&&l(n.resources)&&(o(n,function(t,n){"object"==typeof t?(e[n]=e[n]||{},i(e[n],t)):e[n]=e[n]||t}),i(e.prototype,n.prototype)),e},c.log=function(e){c.debug&&"object"==typeof console&&console.log("[Keen]",e)},c.noConflict=function(){return void 0!==t.Keen&&(t.Keen=c.legacyVersion||r),c},c.ready=function(e){c.loaded?e():c.once("ready",e)},c.prototype.configure=function(e){var t=e||{};return this.config=this.config||{projectId:void 0,writeKey:void 0,host:"api.keen.io",protocol:"https",requestType:"jsonp",resources:i({},c.resources)},"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1&&(t.protocol=document.location.protocol.replace(":","")),t.host&&t.host.replace(/.*?:\/\//g,""),i(this.config,t),this},c.prototype.masterKey=function(e){return arguments.length?(this.config.masterKey=e?String(e):null,this):this.config.masterKey},c.prototype.projectId=function(e){return arguments.length?(this.config.projectId=e?String(e):null,this):this.config.projectId},c.prototype.resources=function(e){if(!arguments.length)return this.config.resources;var t=this;return"object"==typeof e&&o(e,function(e,n){t.config.resources[n]=e||null}),t},c.prototype.url=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=this.config.resources.base||"{protocol}://{host}";return t=e&&"string"==typeof e?this.config.resources[e]?this.config.resources[e]:r+e:r,o(this.config,function(e,n){"object"!=typeof e&&(t=t.replace("{"+n+"}",e))}),o(n,function(e,n){"string"==typeof e?t+="/"+e:"object"==typeof e&&(t+="?",o(e,function(e,n){t+=n+"="+e+"&"}),t=t.slice(0,-1))}),t},function(e){if(c.loaded||"undefined"==typeof document)return void e();null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function e(){document.removeEventListener("DOMContentLoaded",e,!1),document.readyState="complete"},!1),document.readyState="loading");!function e(t){/in/.test(document.readyState)?setTimeout(function(){e(t)},9):t()}(e)}(function(){c.loaded=!0,c.emit("ready")}),e.exports=c}).call(this,"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{})}).call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Keen=void 0;var r=k(n(5)),o=k(n(0)),i=k(n(1)),s=n(33),a=n(32),u=n(25),c=n(10),l=n(24),f=n(22),d=n(21),p=n(20),h=n(6),m=n(19),y=n(8),v=n(18),g=n(17),b=n(7),w=n(16),_=n(9),x=n(14),E=n(13);function k(e){return e&&e.__esModule?e:{default:e}}(0,i.default)(r.default.prototype,{recordEvent:a.recordEvent,recordEvents:a.recordEvents,addEvent:a.addEvent,addEvents:a.addEvents}),(0,i.default)(r.default.prototype,{deferEvent:u.deferEvent,deferEvents:u.deferEvents,queueCapacity:u.queueCapacity,queueInterval:u.queueInterval,recordDeferredEvents:u.recordDeferredEvents}),(0,i.default)(r.default.prototype,{extendEvent:c.extendEvent,extendEvents:c.extendEvents});var T=(0,l.initAutoTrackingCore)(r.default);(0,i.default)(r.default.prototype,{initAutoTracking:T}),r.default.prototype.trackExternalLink=function(e,t,n,r,o){this.emit("error","This method has been deprecated. Check out DOM listeners: https://github.com/keen/keen-tracking.js#listeners");var i,s=e,a=s.currentTarget?s.currentTarget:s.srcElement||s.target,u=r||500,c=!1,l="";void 0!==a.getAttribute?l=a.getAttribute("target"):a.target&&(l=a.target);"_blank"!=l&&"blank"!=l||s.metaKey||(window.open("about:blank").document.location=a.href);"A"===a.nodeName?i=function(){c||s.metaKey||"_blank"===l||"blank"===l||(c=!0,window.location=a.href)}:"FORM"===a.nodeName?i=function(){c||(c=!0,a.submit())}:this.trigger("error","#trackExternalLink method not attached to an <a> or <form> DOM element");o&&(i=function(){c||(c=!0,o())});if(this.recordEvent(t,n,i),setTimeout(i,u),!s.metaKey)return!1},(0,i.default)(r.default.helpers,{getBrowserProfile:f.getBrowserProfile,getDatetimeIndex:d.getDatetimeIndex,getDomainName:p.getDomainName,getDomNodePath:h.getDomNodePath,getDomNodeProfile:m.getDomNodeProfile,getScreenProfile:y.getScreenProfile,getScrollState:v.getScrollState,getUniqueId:g.getUniqueId,getWindowProfile:b.getWindowProfile});var j=(0,s.listenerCore)(r.default);(0,i.default)(r.default.utils,{cookie:w.cookie,deepExtend:_.deepExtend,listener:j,serializeForm:x.serializeForm,timer:E.timer}),r.default.listenTo=function(e){(0,o.default)(e,function(e,t){var n=t.split(" "),r=n[0],o=n.slice(1,n.length).join(" ");return j(o).on(r,e)})},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,n=Number(arguments[1])||0;for((n=n<0?Math.ceil(n):Math.floor(n))<0&&(n+=t);n<t;n++)if(n in this&&this[n]===e)return n;return-1});var S=t.Keen=r.default.extendLibrary(r.default);t.default=S}])}); | ||
*/void 0===(o="function"==typeof(r=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}return function t(n){function r(t,o,i){var s;if(arguments.length>1){if("number"==typeof(i=e({path:"/"},r.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}try{s=JSON.stringify(o),/^[\{\[]/.test(s)&&(o=s)}catch(e){}return o=n.write?n.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",o,i.expires&&"; expires="+i.expires.toUTCString(),i.path&&"; path="+i.path,i.domain&&"; domain="+i.domain,i.secure?"; secure":""].join("")}t||(s={});for(var u=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l<u.length;l++){var f=u[l].split("="),d=f[0].replace(c,decodeURIComponent),p=f.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{if(p=n.read?n.read(p,d):n(p,d)||p.replace(c,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(e){}if(t===d){s=p;break}t||(s[d]=p)}catch(e){}}return s}return r.get=r.set=r,r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}(function(){})})?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cookie=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=s(n(15)),i=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}var a=t.cookie=function e(t){if(arguments.length)return this instanceof e==!1?new e(t):(this.config={key:t,options:{expires:365}},this.data=this.get(),this)};a.prototype.get=function(e){var t={};return o.default.get(this.config.key)&&(t=o.default.getJSON(this.config.key)),e&&"object"===(void 0===t?"undefined":r(t))&&null!==typeof t?void 0!==t[e]?t[e]:null:t},a.prototype.set=function(e,t,n){return arguments.length&&this.enabled()?("string"==typeof e&&arguments.length>=2?this.data[e]=t||null:"object"===(void 0===e?"undefined":r(e))&&1===arguments.length&&(0,i.default)(this.data,e),o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,n||{})),this):this},a.prototype.expire=function(e){return e?o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,{expires:e})):(o.default.remove(this.config.key),this.data={}),this},a.prototype.options=function(e){return arguments.length?(this.config.options="object"===(void 0===e?"undefined":r(e))?e:{},this):this.config.options},a.prototype.enabled=function(){return navigator.cookieEnabled}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"==e?t:3&t|8;return n.toString(16)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getScrollState=function(e){var t="object"===(void 0===e?"undefined":r(e))?e:{},n=(0,s.default)({pixel:0,pixel_max:0,ratio:null,ratio_max:null},t);void 0===("undefined"==typeof window?"undefined":r(window))&&void 0===("undefined"==typeof document?"undefined":r(document))||(n.pixel=(void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)+(window.innerHeight||document.documentElement.clientHeight),n.pixel>n.pixel_max&&(n.pixel_max=n.pixel),n.ratio=parseFloat(Number(n.pixel/a()).toFixed(2)),n.ratio_max=parseFloat(Number(n.pixel_max/a()).toFixed(2)));return n};var o,i=n(1),s=(o=i)&&o.__esModule?o:{default:o};function a(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)||null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomNodeProfile=function(e){return{action:e.action,class:e.className,href:e.href||null,id:e.id,method:e.method,name:e.name,node_name:e.nodeName,selector:(0,r.getDomNodePath)(e),text:e.text,title:e.title,type:e.type,x_position:e.offsetLeft||e.clientLeft||null,y_position:e.offsetTop||e.clientTop||null}};var r=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainName=function(e){var t=function(e){var t;t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t=(t=t.split(":")[0]).split("?")[0]}(e),n=t.split("."),r=n.length;r>2&&(t=n[r-2]+"."+n[r-1],2==n[r-2].length&&2==n[r-1].length&&(t=n[r-3]+"."+t));return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDatetimeIndex=function(e){var t=e||new Date;return{hour_of_day:t.getHours(),day_of_week:parseInt(1+t.getDay()),day_of_month:t.getDate(),month:parseInt(1+t.getMonth()),year:t.getFullYear()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowserProfile=function(){return{cookies:void 0!==navigator.cookieEnabled&&navigator.cookieEnabled,codeName:navigator.appCodeName,description:function(){var e;document&&"function"==typeof document.querySelector&&(e=document.querySelector('meta[name="description"]'));return e?e.content:""}(),language:navigator.language,name:navigator.appName,online:navigator.onLine,platform:navigator.platform,useragent:navigator.userAgent,version:navigator.appVersion,screen:(0,r.getScreenProfile)(),window:(0,o.getWindowProfile)()}};var r=n(8),o=n(7)},function(e){e.exports={name:"keen-tracking",version:"2.0.6",description:"Data Collection SDK for Keen IO",main:"dist/node/keen-tracking.js",browser:"dist/keen-tracking.js",repository:{type:"git",url:"https://github.com/keen/keen-tracking.js.git"},scripts:{start:"NODE_ENV=development webpack-dev-server",test:"NODE_ENV=test jest && NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch",build:"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p",profile:"webpack --profile --json > stats.json",analyze:"webpack-bundle-analyzer stats.json /dist",preversion:"npm run build && npm run test",version:"npm run update_docs && git add .",postversion:"git push && git push --tags",demo:"node ./test/demo/index.node.js",update_docs:"node ./node_modules/replace-in-file/bin/cli.js --configFile=replace-config.js"},bugs:"https://github.com/keen/keen-tracking.js/issues",author:"Keen IO <team@keen.io> (https://keen.io/)",contributors:["Dustin Larimer <dustin@keen.io> (https://github.com/dustinlarimer)","Eric Anderson <eric@keen.io> (https://github.com/aroc)","Joe Wegner <joe@keen.io> (http://www.wegnerdesign.com)","Alex Kleissner <alex@keen.io> (https://github.com/hex337)","Adam Kasprowicz <adam.kasprowicz@keen.io> (https://github.com/adamkasprowicz)"],license:"MIT",dependencies:{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},devDependencies:{"babel-jest":"^23.0.1","babel-loader":"^7.1.4","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.7.0",eslint:"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3",gulp:"^3.8.11","gulp-awspublish":"0.0.23","gulp-rename":"^1.2.2","gulp-replace":"^0.5.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0",jest:"^22.4.3",nock:"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0",webpack:"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initAutoTrackingCore=function(e){return function(t){var n=this,r=e.helpers,o=e.utils,s=o.extend({ignoreDisabledFormFields:!1,ignoreFormFieldTypes:["password"],recordClicks:!0,recordFormSubmits:!0,recordPageViews:!0,recordScrollState:!0,shareUuidAcrossDomains:!1,collectIpAddress:!0},t),a=new Date,u=new o.cookie("keen"),c=u.get("uuid");if(!c){c=r.getUniqueId();var l=r.getDomainName(window.location.hostname),f=l&&s.shareUuidAcrossDomains?{domain:"."+l}:{};u.set("uuid",c,f)}var d={};s.recordScrollState&&(d=r.getScrollState(),o.listener("window").on("scroll",function(){d=r.getScrollState(d)}));var p,h=[{name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"tech"},{name:"keen:url_parser",input:{url:"url.full"},output:"url.info"},{name:"keen:url_parser",input:{url:"referrer.full"},output:"referrer.info"},{name:"keen:date_time_parser",input:{date_time:"keen.timestamp"},output:"time.utc"},{name:"keen:date_time_parser",input:{date_time:"local_time_full"},output:"time.local"}];return s.collectIpAddress?(p="${keen.ip}",h.push({name:"keen:ip_to_geo",input:{ip:"ip_address"},output:"geo"})):p=void 0,n.extendEvents(function(){var e,t,n=r.getBrowserProfile();return{tracked_by:i.default.name+"-"+i.default.version,local_time_full:(new Date).toISOString(),user:{uuid:c},page:{title:document?document.title:null,description:n.description,time_on_page:(e=a,t=(new Date).getTime()-e.getTime(),Math.round(t/1e3))},ip_address:p,geo:{},user_agent:"${keen.user_agent}",tech:{profile:n},url:{full:window?window.location.href:"",info:{}},referrer:{full:document?document.referrer:"",info:{}},time:{local:{},utc:{}},keen:{timestamp:(new Date).toISOString(),addons:h}}}),!0===s.recordClicks&&o.listener("a, a *").on("click",function(e){var t=e.target,o={element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString(),page:{scroll_state:d}};return n.recordEvent("clicks",o)}),!0===s.recordFormSubmits&&o.listener("form").on("submit",function(e){var t=e.target,i={disabled:s.ignoreDisabledFormFields,ignoreTypes:s.ignoreFormFieldTypes},a={form:{action:t.action,fields:o.serializeForm(t,i),method:t.method},element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString(),page:{scroll_state:d}};return n.recordEvent("form_submissions",a)}),!0===s.recordPageViews&&n.recordEvent("pageviews"),n}};var r,o=n(23),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.deferEvent=function(e,t){if(2!==arguments.length||"string"!=typeof e)return void a.call(this,"Incorrect arguments provided to #deferEvent method");this.queue.events[e]=this.queue.events[e]||[],this.queue.events[e].push(t),this.queue.capacity++,this.queue.timer||this.queue.start();return this.emit("deferEvent",e,t),this},t.deferEvents=function(e){var t=this;if(1!==arguments.length||"object"!==(void 0===e?"undefined":r(e)))return void a.call(this,"Incorrect arguments provided to #deferEvents method");return(0,o.default)(e,function(e,n){t.queue.events[n]=t.queue.events[n]||[],t.queue.events[n]=t.queue.events[n].concat(e),t.queue.capacity=t.queue.capacity+e.length,t.queue.timer||t.queue.start()}),t.emit("deferEvents",e),t},t.queueCapacity=function(e){return arguments.length?(this.queue.config.capacity=e?Number(e):0,this.queue.check(),this):this.queue.config.capacity},t.queueInterval=function(e){return arguments.length?(this.queue.config.interval=e?Number(e):0,this.queue.check(),this):this.queue.config.interval},t.recordDeferredEvents=function(){var e,t,n=this;n.queue.capacity>0&&(n.queue.pause(),e=JSON.parse(JSON.stringify(n.queue.config)),t=JSON.parse(JSON.stringify(n.queue.events)),n.queue=(0,i.queue)(),n.queue.config=e,n.queue.on("flush",function(){n.recordDeferredEvents()}),n.emit("recordDeferredEvents",t),n.recordEvents(t,function(e,r){e?n.recordEvents(t):t=void 0}));return n};s(n(5));var o=s(n(0)),i=n(11);function s(e){return e&&e.__esModule?e:{default:e}}function a(e){var t="Event(s) not deferred: "+e;this.emit("error",t)}},function(e,t){e.exports={map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){"use strict";var t,n,r,o,i,s,a,u="",c=0,l=this.map;for(e=this.utf8.encode(e);c<e.length;)t=e.charCodeAt(c++),n=e.charCodeAt(c++),r=e.charCodeAt(c++),o=t>>2,i=(3&t)<<4|n>>4,s=isNaN(n)?64:(15&n)<<2|r>>6,a=isNaN(n)||isNaN(r)?64:63&r,u=u+l.charAt(o)+l.charAt(i)+l.charAt(s)+l.charAt(a);return u},decode:function(e){"use strict";var t,n,r,o,i,s,a="",u=0,c=this.map,l=String.fromCharCode;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=c.indexOf(e.charAt(u++)),i=(15&(n=c.indexOf(e.charAt(u++))))<<4|(r=c.indexOf(e.charAt(u++)))>>2,s=(3&r)<<6|(o=c.indexOf(e.charAt(u++))),a=a+(l(t<<2|n>>4)+(64!=r?l(i):""))+(64!=o?l(s):"");return this.utf8.decode(a)},utf8:{encode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r<e.length;)n+=(t=e.charCodeAt(r++))<128?o(t):t>127&&t<2048?o(t>>6|192)+o(63&t|128):o(t>>12|224)+o(t>>6&63|128)+o(63&t|128);return n},decode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r<e.length;)n+=(t=e.charCodeAt(r))<128?[o(t),r++][0]:t>191&&t<224?[o((31&t)<<6|63&e.charCodeAt(r+1)),r+=2][0]:[o((15&t)<<12|(63&e.charCodeAt(r+1))<<6|63&(c3=e.charCodeAt(r+2))),r+=3][0];return n}}}},function(e,t){!function(e){"use strict";if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};l.prototype.append=function(e,t){e=a(e),t=u(t);var n=this.map[e];this.map[e]=n?n+","+t:t},l.prototype.delete=function(e){delete this.map[a(e)]},l.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},l.prototype.set=function(e,t){this.map[a(e)]=u(t)},l.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),c(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),c(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),c(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var i=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},m.call(y.prototype),m.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var s=[301,302,303,307,308];g.redirect=function(e,t){if(-1===s.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.Headers=l,e.Request=y,e.Response=g,e.fetch=function(e,n){return new Promise(function(r,o){var i=new y(e,n),s=new XMLHttpRequest;s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new g(o,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&t.blob&&(s.responseType="blob"),i.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&r(e))this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,r=f(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=d(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e,t){var n,r,o=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),i.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,s,a,u=1,c={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},d.clearImmediate=p}function p(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(2),n(28))},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(29),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){"use strict";n.r(t),function(e){var t=n(12),r=n(3),o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}();o.Promise?o.Promise.prototype.finally||(o.Promise.prototype.finally=r.a):o.Promise=t.a}.call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.recordEvent=l,t.recordEvents=f,t.addEvent=function(){console.log("addEvent method is depracated. Check out #recordEvent: https://github.com/keen/keen-tracking.js#record-a-single-event"),this.emit("error","This method has been deprecated. Check out #recordEvent: https://github.com/keen/keen-tracking.js#record-a-single-event"),l.apply(this,arguments)},t.addEvents=function(){console.log("addEvents method is depracated. Check out #recordEvents: https://github.com/keen/keen-tracking.js#record-multiple-events"),this.emit("error","This method has been deprecated. Check out #recordEvents: https://github.com/keen/keen-tracking.js#record-multiple-events"),f.apply(this,arguments)},n(31),n(27);var o=c(n(5)),i=c(n(26)),s=c(n(0)),a=c(n(1)),u=n(10);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n,r){var s,c,l,f,g,b,w;if(s=this.url("events",encodeURIComponent(e)),c={},l=n,w="boolean"!=typeof r||r,d.call(this,l)){if(e&&"string"==typeof e){if(this.config.globalProperties&&(console.log("config.globalProperties are deprecated"),c=this.config.globalProperties(e)),(0,a.default)(c,t),b={},(0,u.getExtendedEventBody)(b,this.extensions.events),(0,u.getExtendedEventBody)(b,this.extensions.collections[e]),(0,u.getExtendedEventBody)(b,[c]),this.emit("recordEvent",e,b),!o.default.enabled)return p.call(this,"Keen.enabled is set to false.",l),!1;if(g=(f=this.url("events",encodeURIComponent(e),{api_key:this.writeKey(),data:encodeURIComponent(i.default.encode(JSON.stringify(b))),modified:(new Date).getTime()})).length<function(){if("undefined"!=typeof window&&navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0))return 1900;return 16e3}(),w)switch(this.config.requestType){case"xhr":y.call(this,"POST",s,b,l);break;case"beacon":g?function(e,t){var n=this,r=t,o=document.createElement("img");t=null,o.onload=function(){if(!0,"naturalHeight"in this){if(this.naturalHeight+this.naturalWidth===0)return void this.onerror()}else if(this.width+this.height===0)return void this.onerror();r&&r.call(n)},o.onerror=function(){!0,r&&r.call(n,"An error occurred!",null)},o.src=e+"&c=clv1"}.call(this,f,l):h.call(this,s,b,"Beacon URL length exceeds current browser limit, and XHR is not supported.",l);break;default:if("undefined"!=typeof fetch)return m.call(this,"POST",s,b,l);g?function(e,t){var n=this,r=t,o=(new Date).getTime(),i=document.createElement("script"),s=document.getElementsByTagName("head")[0],a="keenJSONPCallback",u=!1;t=null,a+=o;for(;a in window;)a+="a";function c(){r&&r.call(n,"An error occurred!",null)}function l(){window[a]=void 0;try{delete window[a]}catch(e){}s.removeChild(i)}window[a]=function(e){!0!==u&&(u=!0,r&&r.call(n,null,e),l())},i.src=e+"&jsonp="+a,s.appendChild(i),i.onreadystatechange=function(){!1===u&&"loaded"===this.readyState&&(u=!0,c(),l())},i.onerror=function(){!1===u&&(u=!0,c(),l())}}.call(this,f,l):h.call(this,s,b,"JSONp URL length exceeds current browser limit, and XHR is not supported.",l)}else g&&function(e){var t=v();t&&(t.open("GET",e,!1),t.send(null))}(f);return n=l=null,this}p.call(this,"Collection name must be a string.",l)}}function f(e,t){var n,i,c,l=this;if(n=this.url("events"),i=t,t=null,d.call(this,i))if("object"!==(void 0===e?"undefined":r(e))||e instanceof Array)p.call(this,"First argument must be an object",i);else{if(!(arguments.length>2))return this.config.globalProperties&&(console.log("config.globalProperties are deprecated"),(0,s.default)(e,function(t,n){(0,s.default)(t,function(t,r){var o=l.config.globalProperties(n);e[n][r]=(0,a.default)(o,t)})})),c={},(0,s.default)(e,function(e,t){c[t]=c[t]||[],(0,s.default)(e,function(e,n){var r={};(0,u.getExtendedEventBody)(r,l.extensions.events),(0,u.getExtendedEventBody)(r,l.extensions.collections[t]),(0,u.getExtendedEventBody)(r,[e]),c[t].push(r)})}),this.emit("recordEvents",c),o.default.enabled?this.config.requestType&&"xhr"===this.config.requestType||"undefined"==typeof fetch?(v()&&y.call(this,"POST",n,c,i),t=i=null,this):m.call(this,"POST",n,c,i):(p.call(this,"Keen.enabled is set to false.",i),!1);p.call(this,"Incorrect arguments provided to #recordEvents method",i)}}function d(e){var t=e;return e=null,this.projectId()?!!this.writeKey()||(p.call(this,"Keen.Client is missing a writeKey property.",t),!1):(p.call(this,"Keen.Client is missing a projectId property.",t),!1)}function p(e,t){var n="Event(s) not recorded: "+e;this.emit("error",n),t&&(t.call(this,n,null),t=null)}function h(e,t,n,r){v()?y.call(this,"POST",e,t,r):p.call(this,n)}function m(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=this;return fetch(t,{method:e,body:n?JSON.stringify(n):"",mode:"cors",redirect:"follow",referrerPolicy:o.referrerPolicy()||"unsafe-url",headers:{Authorization:o.writeKey(),"Content-Type":"application/json"}}).then(function(e){return e.ok?e.json():e.json().then(function(t){return Promise.reject({error_code:t.error_code,body:t.message,status:e.status,ok:!1,statusText:e.statusText})})}).then(function(e){return function(e){if(void 0!==e.created)return!!e.created;if(0===Object.keys(e).map(function(t){return e[t].filter(function(e){return!e.success})}).filter(function(e){return e.length>0}).length)return!0;return!1}(e)?(void 0!==r&&r.call(o,null,e),Promise.resolve(e)):(void 0!==r&&r.call(o,e,null),Promise.reject(e))})}function y(e,t,n,r){var i,s=this,a=v(),u=r;r=null,a.onreadystatechange=function(){var e;if(4==a.readyState)if(a.status>=200&&a.status<300){try{e=JSON.parse(a.responseText)}catch(e){o.default.emit("error","Could not parse HTTP response: "+a.responseText),u&&u.call(s,a,null)}u&&e&&u.call(s,null,e)}else o.default.emit("error","HTTP request failed."),u&&u.call(s,a,null)},a.open(e,t,!0),a.setRequestHeader("Authorization",s.writeKey()),a.setRequestHeader("Content-Type","application/json"),n&&(i=JSON.stringify(n)),"GET"===e.toUpperCase()&&a.send(),"POST"===e.toUpperCase()&&a.send(i)}function v(){var e="undefined"==typeof window?this:window;if(e.XMLHttpRequest&&("file:"!=e.location.protocol||!e.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listenerCore=void 0;o(n(4));var r=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}t.listenerCore=function(e){function t(e){if(e)return this instanceof t==!1?new t(e):(this.selector=e,this)}return e.domListeners=e.domListeners||{},t.prototype.on=function(t,n){var o;return 2!==arguments.length||"string"!=typeof t||"function"!=typeof n?this:(void 0===e.domListeners[t]&&(!function(e,t){document.addEventListener?document.addEventListener(e,t,!1):document.attachEvent("on"+e,t)}(t,(o=t,function(t){var n,i;n=t||window.event,i=n.target||n.srcElement,"undefined"!==e.domListeners[o]&&(0,r.default)(e.domListeners[o],function(e,t){!function(e,t){for(var n=(e.parentNode||document).querySelectorAll(t)||[],r=n.length;r--;)if(n[r]==e)return!0;return!1}(i,t)?"window"===t&&(0,r.default)(e,function(e,t){e(n)}):(0,r.default)(e,function(e,t){"click"===o&&"A"===i.nodeName?function(e,t,n){var r,o;if(void 0!==t.getAttribute?r=t.getAttribute("target"):t.target&&(r=t.target),"boolean"==typeof(o=n(e))&&!1===o||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;"_blank"===r||"blank"===r||e.metaKey||t.hasAttribute("download")||(e.preventDefault&&e.preventDefault(),e.returnValue=!1,t.href&&"#"!==t.href&&t.href!==window.location+"#"&&(void 0!==o&&o.then?o.then(function(){window.location=t.href}).catch(function(e){window.location=t.href}):setTimeout(function(){window.location=t.href},500)))}(n,i,e):"submit"===o&&"FORM"===i.nodeName?function(e,t,n){var r=n(e);if("boolean"==typeof r&&!1===r||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;e.preventDefault&&e.preventDefault(),e.returnValue=!1,void 0!==r&&r.then?r.then(function(){t.submit()}).catch(function(e){t.submit()}):setTimeout(function(){t.submit()},500)}(n,i,e):e(n)})})})),e.domListeners[t]={}),e.domListeners[t][this.selector]=e.domListeners[t][this.selector]||[],e.domListeners[t][this.selector].push(n),this)},t.prototype.once=function(e,t){var n=this;function r(){return n.off(e,r),t.apply(n,arguments)}return r.fn=t,n.on(e,r),n},t.prototype.off=function(t,n){var o=this,i=[];if(2===arguments.length)(0,r.default)(e.domListeners[t][o.selector],function(e,t){e!==n&&e.fn!==n&&i.push(e)}),e.domListeners[t][o.selector]=i;else if(1===arguments.length)try{delete e.domListeners[t][o.selector]}catch(n){e.domListeners[t][o.selector]=[]}else(0,r.default)(e.domListeners,function(t,n){try{delete e.domListeners[n][o.selector]}catch(t){e.domListeners[n][o.selector]=function(){}}});return o},t}},function(e,t,n){var r=n(0);n(1);e.exports=function(e){var t=[];return r(e,function(e,n){"string"!=typeof e&&(e=JSON.stringify(e)),t.push(n+"="+encodeURIComponent(e))}),t.join("&")}},function(e,t){e.exports=function(e){var t,n={},r=/\+/g,o=/([^&=]+)=?([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(r," "))},s=e.split("?")[1];for(;t=o.exec(s);)n[i(t[1])]=i(t[2]);return n}},function(e,t,n){(function(t){(function(t){var r=t.Keen||void 0,o=n(0),i=n(1),s=n(35),a=n(34),u=n(4);function c(e){if(this instanceof c==!1)return new c(e);this.configure(e),c.debug&&this.on("error",c.log),this.emit("ready"),c.emit("client",this)}function l(e){return void 0!==e}r&&void 0===r.resources&&(c.legacyVersion=r),u(c),u(c.prototype),i(c,{debug:!1,enabled:!0,loaded:!1,version:"__VERSION__"}),c.helpers=c.helpers||{},c.resources=c.resources||{},i(c.resources,{base:"{protocol}://{host}",version:"{protocol}://{host}/3.0",projects:"{protocol}://{host}/3.0/projects",projectId:"{protocol}://{host}/3.0/projects/{projectId}",events:"{protocol}://{host}/3.0/projects/{projectId}/events",queries:"{protocol}://{host}/3.0/projects/{projectId}/queries"}),c.utils=c.utils||{},i(c.utils,{each:o,extend:i,parseParams:s,serialize:a}),c.extendLibrary=function(e,t){var n=r||t;return l(n)&&l(n.resources)&&(o(n,function(t,n){"object"==typeof t?(e[n]=e[n]||{},i(e[n],t)):e[n]=e[n]||t}),i(e.prototype,n.prototype)),e},c.log=function(e){c.debug&&"object"==typeof console&&console.log("[Keen]",e)},c.noConflict=function(){return void 0!==t.Keen&&(t.Keen=c.legacyVersion||r),c},c.ready=function(e){c.loaded?e():c.once("ready",e)},c.prototype.configure=function(e){var t=e||{};return this.config=this.config||{projectId:void 0,writeKey:void 0,host:"api.keen.io",protocol:"https",requestType:"jsonp",resources:i({},c.resources)},"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1&&(t.protocol=document.location.protocol.replace(":","")),t.host&&t.host.replace(/.*?:\/\//g,""),i(this.config,t),this},c.prototype.masterKey=function(e){return arguments.length?(this.config.masterKey=e?String(e):null,this):this.config.masterKey},c.prototype.projectId=function(e){return arguments.length?(this.config.projectId=e?String(e):null,this):this.config.projectId},c.prototype.resources=function(e){if(!arguments.length)return this.config.resources;var t=this;return"object"==typeof e&&o(e,function(e,n){t.config.resources[n]=e||null}),t},c.prototype.url=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=this.config.resources.base||"{protocol}://{host}";return t=e&&"string"==typeof e?this.config.resources[e]?this.config.resources[e]:r+e:r,o(this.config,function(e,n){"object"!=typeof e&&(t=t.replace("{"+n+"}",e))}),o(n,function(e,n){"string"==typeof e?t+="/"+e:"object"==typeof e&&(t+="?",o(e,function(e,n){t+=n+"="+e+"&"}),t=t.slice(0,-1))}),t},function(e){if(c.loaded||"undefined"==typeof document)return void e();null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function e(){document.removeEventListener("DOMContentLoaded",e,!1),document.readyState="complete"},!1),document.readyState="loading");!function e(t){/in/.test(document.readyState)?setTimeout(function(){e(t)},9):t()}(e)}(function(){c.loaded=!0,c.emit("ready")}),e.exports=c}).call(this,"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{})}).call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Keen=void 0;var r=k(n(5)),o=k(n(0)),i=k(n(1)),s=n(33),a=n(32),u=n(25),c=n(10),l=n(24),f=n(22),d=n(21),p=n(20),h=n(6),m=n(19),y=n(8),v=n(18),g=n(17),b=n(7),w=n(16),_=n(9),x=n(14),E=n(13);function k(e){return e&&e.__esModule?e:{default:e}}(0,i.default)(r.default.prototype,{recordEvent:a.recordEvent,recordEvents:a.recordEvents,addEvent:a.addEvent,addEvents:a.addEvents}),(0,i.default)(r.default.prototype,{deferEvent:u.deferEvent,deferEvents:u.deferEvents,queueCapacity:u.queueCapacity,queueInterval:u.queueInterval,recordDeferredEvents:u.recordDeferredEvents}),(0,i.default)(r.default.prototype,{extendEvent:c.extendEvent,extendEvents:c.extendEvents});var T=(0,l.initAutoTrackingCore)(r.default);(0,i.default)(r.default.prototype,{initAutoTracking:T}),r.default.prototype.trackExternalLink=function(e,t,n,r,o){this.emit("error","This method has been deprecated. Check out DOM listeners: https://github.com/keen/keen-tracking.js#listeners");var i,s=e,a=s.currentTarget?s.currentTarget:s.srcElement||s.target,u=r||500,c=!1,l="";void 0!==a.getAttribute?l=a.getAttribute("target"):a.target&&(l=a.target);"_blank"!=l&&"blank"!=l||s.metaKey||(window.open("about:blank").document.location=a.href);"A"===a.nodeName?i=function(){c||s.metaKey||"_blank"===l||"blank"===l||(c=!0,window.location=a.href)}:"FORM"===a.nodeName?i=function(){c||(c=!0,a.submit())}:this.trigger("error","#trackExternalLink method not attached to an <a> or <form> DOM element");o&&(i=function(){c||(c=!0,o())});if(this.recordEvent(t,n,i),setTimeout(i,u),!s.metaKey)return!1},(0,i.default)(r.default.helpers,{getBrowserProfile:f.getBrowserProfile,getDatetimeIndex:d.getDatetimeIndex,getDomainName:p.getDomainName,getDomNodePath:h.getDomNodePath,getDomNodeProfile:m.getDomNodeProfile,getScreenProfile:y.getScreenProfile,getScrollState:v.getScrollState,getUniqueId:g.getUniqueId,getWindowProfile:b.getWindowProfile});var j=(0,s.listenerCore)(r.default);(0,i.default)(r.default.utils,{cookie:w.cookie,deepExtend:_.deepExtend,listener:j,serializeForm:x.serializeForm,timer:E.timer}),r.default.listenTo=function(e){(0,o.default)(e,function(e,t){var n=t.split(" "),r=n[0],o=n.slice(1,n.length).join(" ");return j(o).on(r,e)})},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,n=Number(arguments[1])||0;for((n=n<0?Math.ceil(n):Math.floor(n))<0&&(n+=t);n<t;n++)if(n in this&&this[n]===e)return n;return-1});var S=t.Keen=r.default.extendLibrary(r.default);t.default=S}])}); | ||
//# sourceMappingURL=keen-tracking.min.js.map |
@@ -389,3 +389,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = {"name":"keen-tracking","version":"2.0.1","description":"Data Collection SDK for Keen IO","main":"dist/node/keen-tracking.js","browser":"dist/keen-tracking.js","repository":{"type":"git","url":"https://github.com/keen/keen-tracking.js.git"},"scripts":{"start":"NODE_ENV=development webpack-dev-server","test":"NODE_ENV=test jest && NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch","build":"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p","profile":"webpack --profile --json > stats.json","analyze":"webpack-bundle-analyzer stats.json /dist","preversion":"npm run build && npm run test","version":"git add .","postversion":"git push && git push --tags","demo":"node ./test/demo/index.node.js"},"bugs":"https://github.com/keen/keen-tracking.js/issues","author":"Keen IO <team@keen.io> (https://keen.io/)","contributors":["Dustin Larimer <dustin@keen.io> (https://github.com/dustinlarimer)","Eric Anderson <eric@keen.io> (https://github.com/aroc)","Joe Wegner <joe@keen.io> (http://www.wegnerdesign.com)","Alex Kleissner <alex@keen.io> (https://github.com/hex337)","Adam Kasprowicz <adam.kasprowicz@keen.io> (https://github.com/adamkasprowicz)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},"devDependencies":{"babel-jest":"^23.0.1","babel-loader":"^7.1.4","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.7.0","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","gulp":"^3.8.11","gulp-awspublish":"0.0.23","gulp-rename":"^1.2.2","gulp-replace":"^0.5.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0","jest":"^22.4.3","nock":"^9.2.6","regenerator-runtime":"^0.11.1","webpack":"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}; | ||
module.exports = {"name":"keen-tracking","version":"2.0.6","description":"Data Collection SDK for Keen IO","main":"dist/node/keen-tracking.js","browser":"dist/keen-tracking.js","repository":{"type":"git","url":"https://github.com/keen/keen-tracking.js.git"},"scripts":{"start":"NODE_ENV=development webpack-dev-server","test":"NODE_ENV=test jest && NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch","build":"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p","profile":"webpack --profile --json > stats.json","analyze":"webpack-bundle-analyzer stats.json /dist","preversion":"npm run build && npm run test","version":"npm run update_docs && git add .","postversion":"git push && git push --tags","demo":"node ./test/demo/index.node.js","update_docs":"node ./node_modules/replace-in-file/bin/cli.js --configFile=replace-config.js"},"bugs":"https://github.com/keen/keen-tracking.js/issues","author":"Keen IO <team@keen.io> (https://keen.io/)","contributors":["Dustin Larimer <dustin@keen.io> (https://github.com/dustinlarimer)","Eric Anderson <eric@keen.io> (https://github.com/aroc)","Joe Wegner <joe@keen.io> (http://www.wegnerdesign.com)","Alex Kleissner <alex@keen.io> (https://github.com/hex337)","Adam Kasprowicz <adam.kasprowicz@keen.io> (https://github.com/adamkasprowicz)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},"devDependencies":{"babel-jest":"^23.0.1","babel-loader":"^7.1.4","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-env":"^1.7.0","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","gulp":"^3.8.11","gulp-awspublish":"0.0.23","gulp-rename":"^1.2.2","gulp-replace":"^0.5.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0","jest":"^22.4.3","nock":"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0","webpack":"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}; | ||
@@ -392,0 +392,0 @@ /***/ }), |
@@ -16,3 +16,4 @@ import pkg from '../package.json'; | ||
recordScrollState: true, | ||
shareUuidAcrossDomains: false | ||
shareUuidAcrossDomains: false, | ||
collectIpAddress: true | ||
}, obj); | ||
@@ -41,2 +42,54 @@ | ||
var addons = [ | ||
{ | ||
name: 'keen:ua_parser', | ||
input: { | ||
ua_string: 'user_agent' | ||
}, | ||
output: 'tech' | ||
}, | ||
{ | ||
name: 'keen:url_parser', | ||
input: { | ||
url: 'url.full' | ||
}, | ||
output: 'url.info' | ||
}, | ||
{ | ||
name: 'keen:url_parser', | ||
input: { | ||
url: 'referrer.full' | ||
}, | ||
output: 'referrer.info' | ||
}, | ||
{ | ||
name: 'keen:date_time_parser', | ||
input: { | ||
date_time: 'keen.timestamp' | ||
}, | ||
output: 'time.utc' | ||
}, | ||
{ | ||
name: 'keen:date_time_parser', | ||
input: { | ||
date_time: 'local_time_full' | ||
}, | ||
output: 'time.local' | ||
} | ||
]; | ||
var ip_address; | ||
if (options.collectIpAddress){ | ||
ip_address = '${keen.ip}'; | ||
addons.push({ | ||
name: 'keen:ip_to_geo', | ||
input: { | ||
ip: 'ip_address' | ||
}, | ||
output : 'geo' | ||
}); | ||
} else { | ||
ip_address = undefined; | ||
} | ||
client.extendEvents(function() { | ||
@@ -56,3 +109,3 @@ var browserProfile = helpers.getBrowserProfile(); | ||
ip_address: '${keen.ip}', | ||
ip_address, | ||
geo: { /* Enriched */ }, | ||
@@ -83,46 +136,3 @@ | ||
timestamp: new Date().toISOString(), | ||
addons: [ | ||
{ | ||
name: 'keen:ip_to_geo', | ||
input: { | ||
ip: 'ip_address' | ||
}, | ||
output : 'geo' | ||
}, | ||
{ | ||
name: 'keen:ua_parser', | ||
input: { | ||
ua_string: 'user_agent' | ||
}, | ||
output: 'tech' | ||
}, | ||
{ | ||
name: 'keen:url_parser', | ||
input: { | ||
url: 'url.full' | ||
}, | ||
output: 'url.info' | ||
}, | ||
{ | ||
name: 'keen:url_parser', | ||
input: { | ||
url: 'referrer.full' | ||
}, | ||
output: 'referrer.info' | ||
}, | ||
{ | ||
name: 'keen:date_time_parser', | ||
input: { | ||
date_time: 'keen.timestamp' | ||
}, | ||
output: 'time.utc' | ||
}, | ||
{ | ||
name: 'keen:date_time_parser', | ||
input: { | ||
date_time: 'local_time_full' | ||
}, | ||
output: 'time.local' | ||
} | ||
], | ||
addons, | ||
} | ||
@@ -129,0 +139,0 @@ }; |
{ | ||
"name": "keen-tracking", | ||
"version": "2.0.2", | ||
"version": "2.0.7", | ||
"description": "Data Collection SDK for Keen IO", | ||
@@ -21,5 +21,6 @@ "main": "dist/node/keen-tracking.js", | ||
"preversion": "npm run build && npm run test", | ||
"version": "git add .", | ||
"version": "npm run update_docs && git add .", | ||
"postversion": "git push && git push --tags", | ||
"demo": "node ./test/demo/index.node.js" | ||
"demo": "node ./test/demo/index.node.js", | ||
"update_docs": "node ./node_modules/replace-in-file/bin/cli.js --configFile=replace-config.js" | ||
}, | ||
@@ -63,2 +64,3 @@ "bugs": "https://github.com/keen/keen-tracking.js/issues", | ||
"regenerator-runtime": "^0.11.1", | ||
"replace-in-file": "^3.4.0", | ||
"webpack": "^4.5.0", | ||
@@ -65,0 +67,0 @@ "webpack-bundle-analyzer": "^2.11.1", |
@@ -5,3 +5,3 @@ # keen-tracking.js [![Build Status](https://travis-ci.org/keen/keen-tracking.js.svg?branch=master)](https://travis-ci.org/keen/keen-tracking.js) | ||
Install this package from npm: | ||
Install this package from NPM *Recommended* | ||
@@ -12,6 +12,6 @@ ```ssh | ||
Or load it from our CDN: | ||
Or load it from our CDN | ||
```html | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-2.0.2.min.js"></script> | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-2.0.7.min.js"></script> | ||
``` | ||
@@ -33,3 +33,3 @@ | ||
If any of this is confusing, that's our fault and we would love to help. Join our [Slack community](https://slack.keen.io) or send us a [message](https://keen.io/support/). | ||
Need help? Ask for it on our [Slack community channel](https://slack.keen.io) or send us a [message](https://keen.io/support/). | ||
@@ -52,3 +52,3 @@ **Using React? Check out these setup guides:** | ||
```html | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-2.0.2.min.js"></script> | ||
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-2.0.7.min.js"></script> | ||
<script> | ||
@@ -69,2 +69,29 @@ Keen.ready(function(){ | ||
### Record Events using JavaScript bundlers like Webpack, RollUp, Parcel | ||
```javascript | ||
import KeenTracking from 'keen-tracking'; | ||
const client = new KeenTracking({ | ||
projectId: 'PROJECT_ID', | ||
writeKey: 'WRITE_KEY' | ||
}); | ||
client | ||
.recordEvent('purchases', { | ||
item: 'Avocado', | ||
number_of_items: 10, | ||
user: { | ||
name: 'John Smith' | ||
} | ||
}) | ||
.then((response) => { | ||
// handle successful responses | ||
}).catch(error => { | ||
// handle errors | ||
}); | ||
``` | ||
--- | ||
### Pageview Tracking (Front-end) | ||
@@ -154,3 +181,5 @@ | ||
client | ||
.recordEvent('pageviews', {}) | ||
.recordEvent('pageviews', { | ||
// more custom data | ||
}) | ||
.then((response) => { | ||
@@ -287,3 +316,3 @@ // handle responses | ||
item: 'Avocado', | ||
price: 123 | ||
number_of_items: 10 | ||
}, (error, response) => { | ||
@@ -290,0 +319,0 @@ if (error) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
681021
42
6792
339
25