Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-gtag

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-gtag - npm Package Compare versions

Comparing version 1.15.1 to 1.16.0

71

dist/vue-gtag.esm.js

@@ -148,3 +148,21 @@ import Vue from 'vue';

};
var validateScreenviewShape = function validateScreenviewShape() {
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
warn("Missing \"appName\" property inside the plugin options.", obj.app_name == null);
warn("Missing \"name\" property in the route.", obj.screen_name == null);
return obj;
};
function getPathWithBase() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
var pathAsArray = path.split("/");
var baseAsArray = base.split("/");
if (pathAsArray[0] === "" && base[base.length - 1] === "/") {
pathAsArray.shift();
}
return baseAsArray.join("/") + pathAsArray.join("/");
}
var getDefaultParams = function getDefaultParams() {

@@ -168,2 +186,3 @@ return {

pageTrackerUseFullPath: false,
pageTrackerPrependBase: true,
pageTrackerSkipSamePath: true,

@@ -255,2 +274,10 @@ globalDataLayerName: "dataLayer",

var router;
var setRouter = function setRouter(instance) {
router = instance;
};
var getRouter = function getRouter() {
return router;
};
var event = (function (name) {

@@ -285,8 +312,12 @@ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var _getOptions = getOptions(),
pageTrackerUseFullPath = _getOptions.pageTrackerUseFullPath;
useFullPath = _getOptions.pageTrackerUseFullPath,
useBase = _getOptions.pageTrackerPrependBase;
var router = getRouter();
var base = router && router.options.base;
var path = useFullPath ? param.fullPath : param.path;
template = _objectSpread2(_objectSpread2({}, param.name && {
page_title: param.name
}), {}, {
page_path: pageTrackerUseFullPath ? param.fullPath : param.path
page_path: useBase ? getPathWithBase(path, base) : path
});

@@ -421,10 +452,2 @@ } else {

var router;
var setRouter = function setRouter(instance) {
router = instance;
};
var getRouter = function getRouter() {
return router;
};
var mergeDefaultParams = function mergeDefaultParams(params) {

@@ -456,24 +479,22 @@ return _objectSpread2({

appName = _getOptions.appName,
pageTrackerTemplate = _getOptions.pageTrackerTemplate,
pageTrackerScreenviewEnabled = _getOptions.pageTrackerScreenviewEnabled,
pageTrackerSkipSamePath = _getOptions.pageTrackerSkipSamePath;
proxy = _getOptions.pageTrackerTemplate,
useScreenview = _getOptions.pageTrackerScreenviewEnabled,
skipSamePath = _getOptions.pageTrackerSkipSamePath;
if (skipSamePath && to.path === from.path) {
return;
}
var template = to;
if (isFn(pageTrackerTemplate)) {
template = pageTrackerTemplate(to, from);
} else if (pageTrackerScreenviewEnabled) {
warn("Missing \"appName\" property inside the plugin options.", appName == null);
warn("Missing \"name\" property in the route with path value \"".concat(to.path, "\"."), to.name == null);
template = {
if (isFn(proxy)) {
template = proxy(to, from);
} else if (useScreenview) {
template = validateScreenviewShape({
app_name: appName,
screen_name: to.name
};
});
}
if (pageTrackerSkipSamePath && to.path === from.path) {
return;
}
if (pageTrackerScreenviewEnabled) {
if (useScreenview) {
screenview(template);

@@ -480,0 +501,0 @@ return;

@@ -154,3 +154,21 @@ 'use strict';

};
var validateScreenviewShape = function validateScreenviewShape() {
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
warn("Missing \"appName\" property inside the plugin options.", obj.app_name == null);
warn("Missing \"name\" property in the route.", obj.screen_name == null);
return obj;
};
function getPathWithBase() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
var pathAsArray = path.split("/");
var baseAsArray = base.split("/");
if (pathAsArray[0] === "" && base[base.length - 1] === "/") {
pathAsArray.shift();
}
return baseAsArray.join("/") + pathAsArray.join("/");
}
var getDefaultParams = function getDefaultParams() {

@@ -174,2 +192,3 @@ return {

pageTrackerUseFullPath: false,
pageTrackerPrependBase: true,
pageTrackerSkipSamePath: true,

@@ -261,2 +280,10 @@ globalDataLayerName: "dataLayer",

var router;
var setRouter = function setRouter(instance) {
router = instance;
};
var getRouter = function getRouter() {
return router;
};
var event = (function (name) {

@@ -291,8 +318,12 @@ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var _getOptions = getOptions(),
pageTrackerUseFullPath = _getOptions.pageTrackerUseFullPath;
useFullPath = _getOptions.pageTrackerUseFullPath,
useBase = _getOptions.pageTrackerPrependBase;
var router = getRouter();
var base = router && router.options.base;
var path = useFullPath ? param.fullPath : param.path;
template = _objectSpread2(_objectSpread2({}, param.name && {
page_title: param.name
}), {}, {
page_path: pageTrackerUseFullPath ? param.fullPath : param.path
page_path: useBase ? getPathWithBase(path, base) : path
});

@@ -427,10 +458,2 @@ } else {

var router;
var setRouter = function setRouter(instance) {
router = instance;
};
var getRouter = function getRouter() {
return router;
};
var mergeDefaultParams = function mergeDefaultParams(params) {

@@ -462,24 +485,22 @@ return _objectSpread2({

appName = _getOptions.appName,
pageTrackerTemplate = _getOptions.pageTrackerTemplate,
pageTrackerScreenviewEnabled = _getOptions.pageTrackerScreenviewEnabled,
pageTrackerSkipSamePath = _getOptions.pageTrackerSkipSamePath;
proxy = _getOptions.pageTrackerTemplate,
useScreenview = _getOptions.pageTrackerScreenviewEnabled,
skipSamePath = _getOptions.pageTrackerSkipSamePath;
if (skipSamePath && to.path === from.path) {
return;
}
var template = to;
if (isFn(pageTrackerTemplate)) {
template = pageTrackerTemplate(to, from);
} else if (pageTrackerScreenviewEnabled) {
warn("Missing \"appName\" property inside the plugin options.", appName == null);
warn("Missing \"name\" property in the route with path value \"".concat(to.path, "\"."), to.name == null);
template = {
if (isFn(proxy)) {
template = proxy(to, from);
} else if (useScreenview) {
template = validateScreenviewShape({
app_name: appName,
screen_name: to.name
};
});
}
if (pageTrackerSkipSamePath && to.path === from.path) {
return;
}
if (pageTrackerScreenviewEnabled) {
if (useScreenview) {
screenview(template);

@@ -486,0 +507,0 @@ return;

@@ -154,3 +154,21 @@ (function (global, factory) {

};
var validateScreenviewShape = function validateScreenviewShape() {
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
warn("Missing \"appName\" property inside the plugin options.", obj.app_name == null);
warn("Missing \"name\" property in the route.", obj.screen_name == null);
return obj;
};
function getPathWithBase() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
var pathAsArray = path.split("/");
var baseAsArray = base.split("/");
if (pathAsArray[0] === "" && base[base.length - 1] === "/") {
pathAsArray.shift();
}
return baseAsArray.join("/") + pathAsArray.join("/");
}
var getDefaultParams = function getDefaultParams() {

@@ -174,2 +192,3 @@ return {

pageTrackerUseFullPath: false,
pageTrackerPrependBase: true,
pageTrackerSkipSamePath: true,

@@ -261,2 +280,10 @@ globalDataLayerName: "dataLayer",

var router;
var setRouter = function setRouter(instance) {
router = instance;
};
var getRouter = function getRouter() {
return router;
};
var event = (function (name) {

@@ -291,8 +318,12 @@ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var _getOptions = getOptions(),
pageTrackerUseFullPath = _getOptions.pageTrackerUseFullPath;
useFullPath = _getOptions.pageTrackerUseFullPath,
useBase = _getOptions.pageTrackerPrependBase;
var router = getRouter();
var base = router && router.options.base;
var path = useFullPath ? param.fullPath : param.path;
template = _objectSpread2(_objectSpread2({}, param.name && {
page_title: param.name
}), {}, {
page_path: pageTrackerUseFullPath ? param.fullPath : param.path
page_path: useBase ? getPathWithBase(path, base) : path
});

@@ -427,10 +458,2 @@ } else {

var router;
var setRouter = function setRouter(instance) {
router = instance;
};
var getRouter = function getRouter() {
return router;
};
var mergeDefaultParams = function mergeDefaultParams(params) {

@@ -462,24 +485,22 @@ return _objectSpread2({

appName = _getOptions.appName,
pageTrackerTemplate = _getOptions.pageTrackerTemplate,
pageTrackerScreenviewEnabled = _getOptions.pageTrackerScreenviewEnabled,
pageTrackerSkipSamePath = _getOptions.pageTrackerSkipSamePath;
proxy = _getOptions.pageTrackerTemplate,
useScreenview = _getOptions.pageTrackerScreenviewEnabled,
skipSamePath = _getOptions.pageTrackerSkipSamePath;
if (skipSamePath && to.path === from.path) {
return;
}
var template = to;
if (isFn(pageTrackerTemplate)) {
template = pageTrackerTemplate(to, from);
} else if (pageTrackerScreenviewEnabled) {
warn("Missing \"appName\" property inside the plugin options.", appName == null);
warn("Missing \"name\" property in the route with path value \"".concat(to.path, "\"."), to.name == null);
template = {
if (isFn(proxy)) {
template = proxy(to, from);
} else if (useScreenview) {
template = validateScreenviewShape({
app_name: appName,
screen_name: to.name
};
});
}
if (pageTrackerSkipSamePath && to.path === from.path) {
return;
}
if (pageTrackerScreenviewEnabled) {
if (useScreenview) {
screenview(template);

@@ -486,0 +507,0 @@ return;

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],n):n((e=e||self).VueGtag={},e.Vue)}(this,(function(e,n){"use strict";function t(e){return(t="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})(e)}function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var i,c=function(e){return"function"==typeof e},u=function(e){return e&&"object"===t(e)&&!Array.isArray(e)},p=function e(n){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;a<t;a++)o[a-1]=arguments[a];if(!o.length)return n;var i=o.shift();if(u(n)&&u(i)){for(var c in i)u(i[c])?(n[c]||Object.assign(n,r({},c,{})),e(n[c],i[c])):Object.assign(n,r({},c,i[c]));return e.apply(void 0,[n].concat(o))}},l=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},f=function(e){l()},d={},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={bootstrap:!0,onReady:null,onError:null,onBeforeTrack:null,onAfterTrack:null,pageTrackerTemplate:null,customResourceURL:"https://www.googletagmanager.com/gtag/js",customPreconnectOrigin:"https://www.googletagmanager.com",deferScriptLoad:!1,pageTrackerExcludedRoutes:[],pageTrackerEnabled:!0,enabled:!0,disableScriptLoad:!1,pageTrackerScreenviewEnabled:!1,appName:null,pageTrackerUseFullPath:!1,pageTrackerSkipSamePath:!0,globalDataLayerName:"dataLayer",globalObjectName:"gtag",defaultGroupName:"default",includes:null,config:{id:null,params:{send_page_view:!1}}};d=p(n,e)},g=function(){return d},y=function(){var e;if(l()){var n=g(),t=n.globalObjectName;(e=window)[t].apply(e,arguments)}},m=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=g(),o=r.config,a=r.includes;y.apply(void 0,["config",o.id].concat(n)),Array.isArray(a)&&a.forEach((function(e){y.apply(void 0,["config",e.id].concat(n))}))},v=function(e,n){l()&&(window["ga-disable-".concat(e)]=n)},h=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=g(),t=n.config,r=n.includes;v(t.id,e),Array.isArray(r)&&r.forEach((function(n){return v(n.id,e)}))},w=function(){h(!0)},b=function(){h(!1)},O=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=g(),r=t.includes,o=t.defaultGroupName;null==n.send_to&&Array.isArray(r)&&r.length&&(n.send_to=r.map((function(e){return e.id})).concat(o)),y("event",e,n)},_=function(e){if(l()){var n;if("string"==typeof e)n={page_path:e};else if(e.path||e.fullPath){var t=g().pageTrackerUseFullPath;n=a(a({},e.name&&{page_title:e.name}),{},{page_path:t?e.fullPath:e.path})}else n=e;null==n.page_location&&(n.page_location=window.location.href),null==n.send_page_view&&(n.send_page_view=!0),O("page_view",n)}},k=function(e){var n,t=g().appName;e&&((n="string"==typeof e?{screen_name:e}:e).app_name=n.app_name||t,O("screen_view",n))},j=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];O.apply(void 0,["exception"].concat(n))},T=function(e){m("linker",e)},P=function(e){O("timing_complete",e)},A=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];y.apply(void 0,["set"].concat(n))},E=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];O.apply(void 0,["refund"].concat(n))},S=function(e){O("purchase",e)},N=function(e){m({custom_map:e})},R=Object.freeze({__proto__:null,query:y,config:m,optOut:w,optIn:b,pageview:_,screenview:k,exception:j,linker:T,time:P,set:A,refund:E,purchase:S,customMap:N,event:O}),x=function(e){return e.$gtag=e.prototype.$gtag=R},L=function(e){i=e},D=function(){return i},M=function(e){return a({send_page_view:!1},e)},B=function(){var e=g(),n=e.config,t=e.includes;y("config",n.id,M(n.params)),Array.isArray(t)&&t.forEach((function(e){y("config",e.id,M(e.params))}))},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=g(),r=t.appName,o=t.pageTrackerTemplate,a=t.pageTrackerScreenviewEnabled,i=t.pageTrackerSkipSamePath,u=e;c(o)?u=o(e,n):a&&(f('Missing "appName" property inside the plugin options.',null==r),f('Missing "name" property in the route with path value "'.concat(e.path,'".'),null==e.name),u={app_name:r,screen_name:e.name}),i&&e.path===n.path||(a?k(u):_(u))},q=function(e){var n=g().pageTrackerExcludedRoutes;return n.includes(e.path)||n.includes(e.name)},G=function(){var e=g(),t=e.onBeforeTrack,r=e.onAfterTrack,o=D();o.onReady((function(){n.nextTick().then((function(){var e=o.currentRoute;B(),q(e)||U(e)})),o.afterEach((function(e,o){n.nextTick().then((function(){q(e)||(c(t)&&t(e,o),U(e,o),c(r)&&r(e,o))}))}))}))},C=function(){var e=g(),n=e.onReady,t=e.onError,r=e.globalObjectName,o=e.globalDataLayerName,a=e.config,i=e.customResourceURL,c=e.customPreconnectOrigin,u=e.deferScriptLoad,p=e.pageTrackerEnabled,f=e.disableScriptLoad,d=Boolean(p&&D());if(function(){if(l()){var e=g(),n=e.enabled,t=e.globalObjectName,r=e.globalDataLayerName;null==window[t]&&(window[r]=window[r]||[],window[t]=function(){window[r].push(arguments)}),window[t]("js",new Date),n||w(),window[t]}}(),d?G():B(),!f)return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(t,r){if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");if(a.async=!0,a.src=e,a.defer=n.defer,n.preconnectOrigin){var i=document.createElement("link");i.href=n.preconnectOrigin,i.rel="preconnect",o.appendChild(i)}o.appendChild(a),a.onload=t,a.onerror=r}}))}("".concat(i,"?id=").concat(a.id,"&l=").concat(o),{preconnectOrigin:c,defer:u}).then((function(){n&&n(window[r])})).catch((function(e){return t&&t(e),e}))},F=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;x(e),s(n),L(t),g().bootstrap&&C()};e.addRoutesTracker=G,e.bootstrap=C,e.config=m,e.customMap=N,e.default=F,e.event=O,e.exception=j,e.install=F,e.linker=T,e.optIn=b,e.optOut=w,e.pageview=_,e.purchase=S,e.query=y,e.refund=E,e.screenview=k,e.set=A,e.setOptions=s,e.setRouter=L,e.time=P,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],n):n((e=e||self).VueGtag={},e.Vue)}(this,(function(e,n){"use strict";function t(e){return(t="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})(e)}function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var i=function(e){return"function"==typeof e},c=function(e){return e&&"object"===t(e)&&!Array.isArray(e)},u=function e(n){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;a<t;a++)o[a-1]=arguments[a];if(!o.length)return n;var i=o.shift();if(c(n)&&c(i)){for(var u in i)c(i[u])?(n[u]||Object.assign(n,r({},u,{})),e(n[u],i[u])):Object.assign(n,r({},u,i[u]));return e.apply(void 0,[n].concat(o))}},p=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},l=function(e){p()},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l('Missing "appName" property inside the plugin options.',null==e.app_name),l('Missing "name" property in the route.',null==e.screen_name),e};function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=e.split("/"),r=n.split("/");return""===t[0]&&"/"===n[n.length-1]&&t.shift(),r.join("/")+t.join("/")}var s,g={},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={bootstrap:!0,onReady:null,onError:null,onBeforeTrack:null,onAfterTrack:null,pageTrackerTemplate:null,customResourceURL:"https://www.googletagmanager.com/gtag/js",customPreconnectOrigin:"https://www.googletagmanager.com",deferScriptLoad:!1,pageTrackerExcludedRoutes:[],pageTrackerEnabled:!0,enabled:!0,disableScriptLoad:!1,pageTrackerScreenviewEnabled:!1,appName:null,pageTrackerUseFullPath:!1,pageTrackerPrependBase:!0,pageTrackerSkipSamePath:!0,globalDataLayerName:"dataLayer",globalObjectName:"gtag",defaultGroupName:"default",includes:null,config:{id:null,params:{send_page_view:!1}}};g=u(n,e)},y=function(){return g},v=function(){var e;if(p()){var n=y(),t=n.globalObjectName;(e=window)[t].apply(e,arguments)}},h=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=y(),o=r.config,a=r.includes;v.apply(void 0,["config",o.id].concat(n)),Array.isArray(a)&&a.forEach((function(e){v.apply(void 0,["config",e.id].concat(n))}))},w=function(e,n){p()&&(window["ga-disable-".concat(e)]=n)},b=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=y(),t=n.config,r=n.includes;w(t.id,e),Array.isArray(r)&&r.forEach((function(n){return w(n.id,e)}))},O=function(){b(!0)},_=function(){b(!1)},k=function(e){s=e},j=function(){return s},T=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=y(),r=t.includes,o=t.defaultGroupName;null==n.send_to&&Array.isArray(r)&&r.length&&(n.send_to=r.map((function(e){return e.id})).concat(o)),v("event",e,n)},P=function(e){if(p()){var n;if("string"==typeof e)n={page_path:e};else if(e.path||e.fullPath){var t=y(),r=t.pageTrackerUseFullPath,o=t.pageTrackerPrependBase,i=j(),c=i&&i.options.base,u=r?e.fullPath:e.path;n=a(a({},e.name&&{page_title:e.name}),{},{page_path:o?d(u,c):u})}else n=e;null==n.page_location&&(n.page_location=window.location.href),null==n.send_page_view&&(n.send_page_view=!0),T("page_view",n)}},A=function(e){var n,t=y().appName;e&&((n="string"==typeof e?{screen_name:e}:e).app_name=n.app_name||t,T("screen_view",n))},E=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];T.apply(void 0,["exception"].concat(n))},S=function(e){h("linker",e)},N=function(e){T("timing_complete",e)},R=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];v.apply(void 0,["set"].concat(n))},x=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];T.apply(void 0,["refund"].concat(n))},L=function(e){T("purchase",e)},D=function(e){h({custom_map:e})},B=Object.freeze({__proto__:null,query:v,config:h,optOut:O,optIn:_,pageview:P,screenview:A,exception:E,linker:S,time:N,set:R,refund:x,purchase:L,customMap:D,event:T}),M=function(e){return e.$gtag=e.prototype.$gtag=B},U=function(e){return a({send_page_view:!1},e)},q=function(){var e=y(),n=e.config,t=e.includes;v("config",n.id,U(n.params)),Array.isArray(t)&&t.forEach((function(e){v("config",e.id,U(e.params))}))},G=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=y(),r=t.appName,o=t.pageTrackerTemplate,a=t.pageTrackerScreenviewEnabled,c=t.pageTrackerSkipSamePath;if(!c||e.path!==n.path){var u=e;i(o)?u=o(e,n):a&&(u=f({app_name:r,screen_name:e.name})),a?A(u):P(u)}},C=function(e){var n=y().pageTrackerExcludedRoutes;return n.includes(e.path)||n.includes(e.name)},F=function(){var e=y(),t=e.onBeforeTrack,r=e.onAfterTrack,o=j();o.onReady((function(){n.nextTick().then((function(){var e=o.currentRoute;q(),C(e)||G(e)})),o.afterEach((function(e,o){n.nextTick().then((function(){C(e)||(i(t)&&t(e,o),G(e,o),i(r)&&r(e,o))}))}))}))},I=function(){var e=y(),n=e.onReady,t=e.onError,r=e.globalObjectName,o=e.globalDataLayerName,a=e.config,i=e.customResourceURL,c=e.customPreconnectOrigin,u=e.deferScriptLoad,l=e.pageTrackerEnabled,f=e.disableScriptLoad,d=Boolean(l&&j());if(function(){if(p()){var e=y(),n=e.enabled,t=e.globalObjectName,r=e.globalDataLayerName;null==window[t]&&(window[r]=window[r]||[],window[t]=function(){window[r].push(arguments)}),window[t]("js",new Date),n||O(),window[t]}}(),d?F():q(),!f)return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(t,r){if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");if(a.async=!0,a.src=e,a.defer=n.defer,n.preconnectOrigin){var i=document.createElement("link");i.href=n.preconnectOrigin,i.rel="preconnect",o.appendChild(i)}o.appendChild(a),a.onload=t,a.onerror=r}}))}("".concat(i,"?id=").concat(a.id,"&l=").concat(o),{preconnectOrigin:c,defer:u}).then((function(){n&&n(window[r])})).catch((function(e){return t&&t(e),e}))},V=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;M(e),m(n),k(t),y().bootstrap&&I()};e.addRoutesTracker=F,e.bootstrap=I,e.config=h,e.customMap=D,e.default=V,e.event=T,e.exception=E,e.install=V,e.linker=S,e.optIn=_,e.optOut=O,e.pageview=P,e.purchase=L,e.query=v,e.refund=x,e.screenview=A,e.set=R,e.setOptions=m,e.setRouter=k,e.time=N,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=vue-gtag.umd.min.js.map
{
"name": "vue-gtag",
"description": "Global Site Tag (gtag.js) plugin for Vue",
"version": "1.15.1",
"version": "1.16.0",
"author": {

@@ -6,0 +6,0 @@ "name": "Matteo Gabriele",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc