🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

vue-multianalytics

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-multianalytics - npm Package Compare versions

Comparing version

to
1.3.9

2

dist/vue-multianalytics.min.js

@@ -1,1 +0,1 @@

module.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=r(i),c=n(3),u=r(c),l=n(7),s=r(l),f=n(8),p=r(f),d=n(9),v=r(d),g=n(6),y=(o(g),n(4)),h=o(y),b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];e.modulesEnabled=[];for(var o in t.modules){var r=void 0;switch(o){case h.MODULE_GA:r=new u.default,r.init(t.modules[o]);break;case h.MODULE_MIXPANEL:r=new s.default,r.init(t.modules[o]);break;case h.MODULE_SEGMENT:r=new p.default,r.init(t.modules[o]);break;case h.MODULE_FACEBOOK:r=new v.default,r.init(t.modules[o])}r&&e.modulesEnabled.push(r)}t.routing&&t.routing.vueRouter&&m(e,t.routing);var i=new a.default(e.modulesEnabled);e.prototype.$multianalytics=e.prototype.$ma=e.ma=i,n&&(e.prototype.$multianalyticsm=e.prototype.$mam=e.mam=n(i))},m=function(e,t){return t.ignoredViews&&(t.ignoredViews=t.ignoredViews.map(function(e){return e.toLowerCase()})),t.vueRouter.afterEach(function(n){t.ignoredViews&&t.ignoredViews.indexOf(n[t.preferredProperty].toLowerCase())!==-1||e.ma.trackView({viewName:n.meta.analytics||n[preferredProperty]},t.ignoredModules)}),t.ignoredViews};t.default={install:b}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t){n(this,e),this.modulesEnabled=t}return o(e,[{key:"trackView",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.viewName&&this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackView(e)})}},{key:"trackEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackEvent(e)})}},{key:"trackException",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackException(e)})}},{key:"trackTiming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackTiming(e)})}},{key:"setUsername",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setUsername(e)})}},{key:"setUserProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setUserProperties(e)})}},{key:"setUserPropertiesOnce",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setUserPropertiesOnce(e)})}},{key:"setSuperProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setSuperProperties(e)})}},{key:"setSuperPropertiesOnce",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setSuperPropertiesOnce(e)})}},{key:"setAlias",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setAlias(e)})}}]),e}();t.default=r},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(4),l=n(5),s=o(l),f=n(6),p=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.MODULE_GA));return e.settings={additionalAccountNames:[],userId:null},e}return a(t,e),c(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t,n,o,r,i,a){e.GoogleAnalyticsObject=r,e[r]=e[r]||function(){(e[r].q=e[r].q||[]).push(arguments)},e[r].l=1*new Date,i=t.createElement(n),a=t.getElementsByTagName(n)[0],i.async=1,i.src=o,a.parentNode.insertBefore(i,a)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga");var t=["trackingId","appName","appVersion"];t.forEach(function(t){if(!e[t])throw new Error('VueAnalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,ga("create",e.trackingId,"auto"),ga("set","transport","beacon"),ga("set","appName",e.appName),ga("set","appVersion",e.appVersion)}},{key:"trackView",value:function(e){var t=e.viewName;this.config.debug&&(0,f.logDebug)(t);var n={hitType:"pageview",page:t};this.settings.userId&&ga("set","&uid",this.settings.userId),ga("send",n)}},{key:"trackEvent",value:function(e){var t=e.category,n=void 0===t?"Event":t,o=e.action,r=e.label,i=void 0===r?null:r,a=e.value,c=void 0===a?null:a,u=e.callback,l=void 0===u?null:u;if(this.config.debug&&f.logDebug.apply(void 0,arguments),c){var s=parseInt(c,10);c=isNaN(s)?0:s}var p={hitType:"event",eventCategory:n,eventAction:o,eventLabel:i,eventValue:c,hitCallback:l,userId:this.settings.userId};ga("send",p)}},{key:"trackException",value:function(e){var t=e.description,n=void 0===t?"":t,o=e.isFatal,r=void 0!==o&&o;this.config.debug&&(0,f.logDebug)({description:n,isFatal:r}),ga("send","exception",{exDescription:n,exFatal:r})}},{key:"trackTiming",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.config.debug&&(0,f.logDebug)({timingCategory:e,timingVar:t,timingValue:n,timingLabel:o});var r={hitType:"timing",timingCategory:e,timingVar:t,timingValue:n};o&&(r.timingLabel=o),ga("send",r)}},{key:"setUsername",value:function(e){var t=e.name;this.settings.userId=t}},{key:"setUserProperties",value:function(e){e.properties}}]),t}(s.default);t.default=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MODULE_GA="ga",t.MODULE_MIXPANEL="mixpanel",t.MODULE_SEGMENT="segment",t.MODULE_FACEBOOK="facebook"},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,e),this.name=t,this.config=o}return o(e,[{key:"trackView",value:function(){}},{key:"trackEvent",value:function(){}},{key:"trackException",value:function(){}},{key:"trackTiming",value:function(){}},{key:"setAlias",value:function(){}},{key:"identify",value:function(){}},{key:"setUsername",value:function(){}},{key:"setUserProperties",value:function(){}},{key:"setUserPropertiesOnce",value:function(){}},{key:"setSuperProperties",value:function(){}},{key:"setSuperPropertiesOnce",value:function(){}}]),e}();t.default=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.logDebug=function(e){var t;(t=console).log.apply(t,["VueAnalytics :"].concat(Array.prototype.slice.call(arguments)))},t.cordovaApp={bootstrapWindows:function(){window.ActiveXObject=void 0,ga("set","checkProtocolTask",null)}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(4),l=n(5),s=o(l),f=n(6),p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.MODULE_MIXPANEL))}return a(t,e),c(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!t.__SV){var n=window;try{var o,r,i,a=n.location,c=a.hash;o=function(e,t){return(r=e.match(RegExp(t+"=([^&]*)")))?r[1]:null},c&&o(c,"state")&&(i=JSON.parse(decodeURIComponent(o(c,"state"))),"mpeditor"===i.action&&(n.sessionStorage.setItem("_mpcehash",c),history.replaceState(i.desiredHash||"",e.title,a.pathname+a.search)))}catch(e){}var u,l;window.mixpanel=t,t._i=[],t.init=function(e,n,o){function r(e,t){var n=t.split(".");2==n.length&&(e=e[n[0]],t=n[1]),e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}}var i=t;for("undefined"!=typeof o?i=t[o]=[]:o="mixpanel",i.people=i.people||[],i.toString=function(e){var t="mixpanel";return"mixpanel"!==o&&(t+="."+o),e||(t+=" (stub)"),t},i.people.toString=function(){return i.toString(1)+".people (stub)"},u="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" "),l=0;l<u.length;l++)r(i,u[l]);t._i.push([e,n,o])},t.__SV=1.2,n=e.createElement("script"),n.type="text/javascript",n.async=!0,n.src="undefined"!=typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js",o=e.getElementsByTagName("script")[0],o.parentNode.insertBefore(n,o)}}(document,window.mixpanel||[]);var t=["token"];t.forEach(function(t){if(!e[t])throw new Error('VueMultianalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,mixpanel.init(e.token,e.config)}},{key:"trackView",value:function(e){var t=e.viewName;this.config.debug&&(0,f.logDebug)(t),mixpanel.track("Page Viewed",{page:t})}},{key:"trackEvent",value:function(e){var t=e.action,n=e.properties,o=void 0===n?null:n,r=e.callback,i=void 0===r?null:r;this.config.debug&&f.logDebug.apply(void 0,arguments),mixpanel.track(t,o,i)}},{key:"setAlias",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.alias(e)}},{key:"setUsername",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.identify(e)}},{key:"setUserProperties",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.people.set(e)}},{key:"setUserPropertiesOnce",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.people.set_once(e)}},{key:"setSuperProperties",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.register(e)}},{key:"setSuperPropertiesOnce",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.register_once(e)}}]),t}(s.default);t.default=p},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(4),l=n(5),s=o(l),f=(n(6),function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.MODULE_SEGMENT));return e.superProperties={},e}return a(t,e),c(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(){var e=window.analytics=window.analytics||[];if(!e.initialize)if(e.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{e.invoked=!0,e.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"],e.factory=function(t){return function(){var n=Array.prototype.slice.call(arguments);return n.unshift(t),e.push(n),e}};for(var t=0;t<e.methods.length;t++){var n=e.methods[t];e[n]=e.factory(n)}e.load=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+e+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)},e.SNIPPET_VERSION="4.0.0"}}();var t=["token"];t.forEach(function(t){if(!e[t])throw new Error('VueMultianalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,analytics.load(e.token),this.config.debug&&analytics.debug()}},{key:"trackView",value:function(e){var t=e.viewName;try{analytics.page(t)}catch(e){if(!(e instanceof ReferenceError))throw e}}},{key:"trackEvent",value:function(e){var t=(e.category,e.action),n=(e.label,e.value,e.properties),o=void 0===n?{}:n;e.callback;try{var r=Object.assign(this.superProperties,o);analytics.track(t,r)}catch(e){if(!(e instanceof ReferenceError))throw e}}},{key:"setUserProperties",value:function(e){try{e.userId?analytics.identify(e.userId,e):analytics.identify(e)}catch(e){if(!(e instanceof ReferenceError))throw e}}},{key:"setSuperProperties",value:function(e){this.superProperties=e}},{key:"setAlias",value:function(e){try{analytics.alias(e)}catch(e){if(!(e instanceof ReferenceError))throw e}}}]),t}(s.default));t.default=f},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(null==e)throw new TypeError("Cannot destructure undefined")}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(4),s=n(5),f=o(s),p=n(6),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.MODULE_FACEBOOK))}return c(t,e),u(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t,n,o,r,i,a){e.fbq||(r=e.fbq=function(){r.callMethod?r.callMethod.apply(r,arguments):r.queue.push(arguments)},e._fbq||(e._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[],i=t.createElement(n),i.async=!0,i.src=o,a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(i,a))}(window,document,"script","https://connect.facebook.net/en_US/fbevents.js");var t=["token"];t.forEach(function(t){if(!e[t])throw new Error('VueAnalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,fbq("init",e.token)}},{key:"trackView",value:function(e){r(e),fbq("track","PageView")}},{key:"trackEvent",value:function(e){var t=e.fb_event,n=void 0===t?"viewContent":t,o=e.category,r=void 0===o?"Event":o,i=(e.action,e.label),a=void 0===i?null:i,c=e.value,u=void 0===c?null:c,l=(e.callback,e.ids),s=void 0===l?[]:l,f=e.type,d=void 0===f?null:f,v=e.currency,g=void 0===v?null:v;if(this.config.debug&&p.logDebug.apply(void 0,arguments),u){var y=parseInt(u,10);u=isNaN(y)?0:y}var h={content_name:a,content_category:r,content_ids:s,content_type:d,value:u,currency:g};fbq("track",n,h)}}]),t}(f.default);t.default=d}]);
module.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=r(i),c=n(3),u=r(c),l=n(7),s=r(l),f=n(8),p=r(f),d=n(9),v=r(d),g=n(6),y=(o(g),n(4)),h=o(y),b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];e.modulesEnabled=[];for(var o in t.modules){var r=void 0;switch(o){case h.MODULE_GA:r=new u.default,r.init(t.modules[o]);break;case h.MODULE_MIXPANEL:r=new s.default,r.init(t.modules[o]);break;case h.MODULE_SEGMENT:r=new p.default,r.init(t.modules[o]);break;case h.MODULE_FACEBOOK:r=new v.default,r.init(t.modules[o])}r&&e.modulesEnabled.push(r)}t.routing&&t.routing.vueRouter&&m(e,t.routing);var i=new a.default(e.modulesEnabled);e.prototype.$multianalytics=e.prototype.$ma=e.ma=i,n&&(e.prototype.$multianalyticsm=e.prototype.$mam=e.mam=n(i))},m=function(e,t){return t.ignoredViews&&(t.ignoredViews=t.ignoredViews.map(function(e){return e.toLowerCase()})),t.preferredProperty||(t.preferredProperty="path"),t.vueRouter.afterEach(function(n){t.ignoredViews&&t.ignoredViews.indexOf(n[t.preferredProperty].toLowerCase())!==-1||e.ma.trackView({viewName:n.meta.analytics||n[t.preferredProperty]},t.ignoredModules)}),t.ignoredViews};t.default={install:b}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t){n(this,e),this.modulesEnabled=t}return o(e,[{key:"trackView",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.viewName&&this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackView(e)})}},{key:"trackEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackEvent(e)})}},{key:"trackException",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackException(e)})}},{key:"trackTiming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.trackTiming(e)})}},{key:"setUsername",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setUsername(e)})}},{key:"setUserProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setUserProperties(e)})}},{key:"setUserPropertiesOnce",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setUserPropertiesOnce(e)})}},{key:"setSuperProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setSuperProperties(e)})}},{key:"setSuperPropertiesOnce",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setSuperPropertiesOnce(e)})}},{key:"setAlias",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.modulesEnabled.forEach(function(n){t.indexOf(n.name)===-1&&n.setAlias(e)})}}]),e}();t.default=r},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(4),l=n(5),s=o(l),f=n(6),p=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.MODULE_GA));return e.settings={additionalAccountNames:[],userId:null},e}return a(t,e),c(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t,n,o,r,i,a){e.GoogleAnalyticsObject=r,e[r]=e[r]||function(){(e[r].q=e[r].q||[]).push(arguments)},e[r].l=1*new Date,i=t.createElement(n),a=t.getElementsByTagName(n)[0],i.async=1,i.src=o,a.parentNode.insertBefore(i,a)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga");var t=["trackingId","appName","appVersion"];t.forEach(function(t){if(!e[t])throw new Error('VueAnalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,ga("create",e.trackingId,"auto"),ga("set","transport","beacon"),ga("set","appName",e.appName),ga("set","appVersion",e.appVersion)}},{key:"trackView",value:function(e){var t=e.viewName;this.config.debug&&(0,f.logDebug)(t);var n={hitType:"pageview",page:t};this.settings.userId&&ga("set","&uid",this.settings.userId),ga("send",n)}},{key:"trackEvent",value:function(e){var t=e.category,n=void 0===t?"Event":t,o=e.action,r=e.label,i=void 0===r?null:r,a=e.value,c=void 0===a?null:a,u=e.callback,l=void 0===u?null:u;if(this.config.debug&&f.logDebug.apply(void 0,arguments),c){var s=parseInt(c,10);c=isNaN(s)?0:s}var p={hitType:"event",eventCategory:n,eventAction:o,eventLabel:i,eventValue:c,hitCallback:l,userId:this.settings.userId};ga("send",p)}},{key:"trackException",value:function(e){var t=e.description,n=void 0===t?"":t,o=e.isFatal,r=void 0!==o&&o;this.config.debug&&(0,f.logDebug)({description:n,isFatal:r}),ga("send","exception",{exDescription:n,exFatal:r})}},{key:"trackTiming",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.config.debug&&(0,f.logDebug)({timingCategory:e,timingVar:t,timingValue:n,timingLabel:o});var r={hitType:"timing",timingCategory:e,timingVar:t,timingValue:n};o&&(r.timingLabel=o),ga("send",r)}},{key:"setUsername",value:function(e){var t=e.name;this.settings.userId=t}},{key:"setUserProperties",value:function(e){e.properties}}]),t}(s.default);t.default=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MODULE_GA="ga",t.MODULE_MIXPANEL="mixpanel",t.MODULE_SEGMENT="segment",t.MODULE_FACEBOOK="facebook"},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,e),this.name=t,this.config=o}return o(e,[{key:"trackView",value:function(){}},{key:"trackEvent",value:function(){}},{key:"trackException",value:function(){}},{key:"trackTiming",value:function(){}},{key:"setAlias",value:function(){}},{key:"identify",value:function(){}},{key:"setUsername",value:function(){}},{key:"setUserProperties",value:function(){}},{key:"setUserPropertiesOnce",value:function(){}},{key:"setSuperProperties",value:function(){}},{key:"setSuperPropertiesOnce",value:function(){}}]),e}();t.default=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.logDebug=function(e){var t;(t=console).log.apply(t,["VueAnalytics :"].concat(Array.prototype.slice.call(arguments)))},t.cordovaApp={bootstrapWindows:function(){window.ActiveXObject=void 0,ga("set","checkProtocolTask",null)}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(4),l=n(5),s=o(l),f=n(6),p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.MODULE_MIXPANEL))}return a(t,e),c(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!t.__SV){var n=window;try{var o,r,i,a=n.location,c=a.hash;o=function(e,t){return(r=e.match(RegExp(t+"=([^&]*)")))?r[1]:null},c&&o(c,"state")&&(i=JSON.parse(decodeURIComponent(o(c,"state"))),"mpeditor"===i.action&&(n.sessionStorage.setItem("_mpcehash",c),history.replaceState(i.desiredHash||"",e.title,a.pathname+a.search)))}catch(e){}var u,l;window.mixpanel=t,t._i=[],t.init=function(e,n,o){function r(e,t){var n=t.split(".");2==n.length&&(e=e[n[0]],t=n[1]),e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}}var i=t;for("undefined"!=typeof o?i=t[o]=[]:o="mixpanel",i.people=i.people||[],i.toString=function(e){var t="mixpanel";return"mixpanel"!==o&&(t+="."+o),e||(t+=" (stub)"),t},i.people.toString=function(){return i.toString(1)+".people (stub)"},u="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" "),l=0;l<u.length;l++)r(i,u[l]);t._i.push([e,n,o])},t.__SV=1.2,n=e.createElement("script"),n.type="text/javascript",n.async=!0,n.src="undefined"!=typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js",o=e.getElementsByTagName("script")[0],o.parentNode.insertBefore(n,o)}}(document,window.mixpanel||[]);var t=["token"];t.forEach(function(t){if(!e[t])throw new Error('VueMultianalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,mixpanel.init(e.token,e.config)}},{key:"trackView",value:function(e){var t=e.viewName;this.config.debug&&(0,f.logDebug)(t),mixpanel.track("Page Viewed",{page:t})}},{key:"trackEvent",value:function(e){var t=e.action,n=e.properties,o=void 0===n?null:n,r=e.callback,i=void 0===r?null:r;this.config.debug&&f.logDebug.apply(void 0,arguments),mixpanel.track(t,o,i)}},{key:"setAlias",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.alias(e)}},{key:"setUsername",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.identify(e)}},{key:"setUserProperties",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.people.set(e)}},{key:"setUserPropertiesOnce",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.people.set_once(e)}},{key:"setSuperProperties",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.register(e)}},{key:"setSuperPropertiesOnce",value:function(e){this.config.debug&&(0,f.logDebug)(e),mixpanel.register_once(e)}}]),t}(s.default);t.default=p},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u=n(4),l=n(5),s=o(l),f=(n(6),function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.MODULE_SEGMENT));return e.superProperties={},e}return a(t,e),c(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(){var e=window.analytics=window.analytics||[];if(!e.initialize)if(e.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{e.invoked=!0,e.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"],e.factory=function(t){return function(){var n=Array.prototype.slice.call(arguments);return n.unshift(t),e.push(n),e}};for(var t=0;t<e.methods.length;t++){var n=e.methods[t];e[n]=e.factory(n)}e.load=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+e+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)},e.SNIPPET_VERSION="4.0.0"}}();var t=["token"];t.forEach(function(t){if(!e[t])throw new Error('VueMultianalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,analytics.load(e.token),this.config.debug&&analytics.debug()}},{key:"trackView",value:function(e){var t=e.viewName;try{analytics.page(t)}catch(e){if(!(e instanceof ReferenceError))throw e}}},{key:"trackEvent",value:function(e){var t=(e.category,e.action),n=(e.label,e.value,e.properties),o=void 0===n?{}:n;e.callback;try{var r=Object.assign(this.superProperties,o);analytics.track(t,r)}catch(e){if(!(e instanceof ReferenceError))throw e}}},{key:"setUserProperties",value:function(e){try{e.userId?analytics.identify(e.userId,e):analytics.identify(e)}catch(e){if(!(e instanceof ReferenceError))throw e}}},{key:"setSuperProperties",value:function(e){this.superProperties=e}},{key:"setAlias",value:function(e){try{analytics.alias(e)}catch(e){if(!(e instanceof ReferenceError))throw e}}}]),t}(s.default));t.default=f},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(null==e)throw new TypeError("Cannot destructure undefined")}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(4),s=n(5),f=o(s),p=n(6),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.MODULE_FACEBOOK))}return c(t,e),u(t,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t,n,o,r,i,a){e.fbq||(r=e.fbq=function(){r.callMethod?r.callMethod.apply(r,arguments):r.queue.push(arguments)},e._fbq||(e._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[],i=t.createElement(n),i.async=!0,i.src=o,a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(i,a))}(window,document,"script","https://connect.facebook.net/en_US/fbevents.js");var t=["token"];t.forEach(function(t){if(!e[t])throw new Error('VueAnalytics : Please provide a "'+t+'" from the config.')}),this.config.debug=e.debug,fbq("init",e.token)}},{key:"trackView",value:function(e){r(e),fbq("track","PageView")}},{key:"trackEvent",value:function(e){var t=e.fb_event,n=void 0===t?"viewContent":t,o=e.category,r=void 0===o?"Event":o,i=(e.action,e.label),a=void 0===i?null:i,c=e.value,u=void 0===c?null:c,l=(e.callback,e.ids),s=void 0===l?[]:l,f=e.type,d=void 0===f?null:f,v=e.currency,g=void 0===v?null:v;if(this.config.debug&&p.logDebug.apply(void 0,arguments),u){var y=parseInt(u,10);u=isNaN(y)?0:y}var h={content_name:a,content_category:r,content_ids:s,content_type:d,value:u,currency:g};fbq("track",n,h)}}]),t}(f.default);t.default=d}]);
{
"name": "vue-multianalytics",
"version": "1.3.8",
"version": "1.3.9",
"description": "A vue multianalytics tool",

@@ -5,0 +5,0 @@ "main": "./dist/vue-multianalytics.min.js",

@@ -77,2 +77,5 @@ import AnalyticsPlugin from './AnalyticsPlugin'

if (!routing.preferredProperty) {
routing.preferredProperty = 'path'
}

@@ -86,3 +89,3 @@

// Dispatch vue event using meta analytics value if defined otherwise fallback to route name
Vue.ma.trackView({viewName: to.meta.analytics || to[preferredProperty]}, routing.ignoredModules)
Vue.ma.trackView({viewName: to.meta.analytics || to[routing.preferredProperty]}, routing.ignoredModules)
})

@@ -89,0 +92,0 @@