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.6.5 to 1.7.0

8

dist/vue-gtag.esm.js

@@ -357,2 +357,3 @@ function _typeof(obj) {

globalObjectName = _getOptions.globalObjectName,
globalDataLayerName = _getOptions.globalDataLayerName,
id = _getOptions.config.id,

@@ -371,6 +372,6 @@ pageTrackerEnabled = _getOptions.pageTrackerEnabled,

if (window[globalObjectName] == null) {
window.dataLayer = window.dataLayer || [];
window[globalDataLayerName] = window[globalDataLayerName] || [];
window[globalObjectName] = function () {
window.dataLayer.push(arguments);
window[globalDataLayerName].push(arguments);
};

@@ -392,3 +393,3 @@ }

var domain = "https://www.googletagmanager.com";
var resource = "".concat(domain, "/gtag/js?id=").concat(id);
var resource = "".concat(domain, "/gtag/js?id=").concat(id, "&l=").concat(globalDataLayerName);
return loadScript(resource, domain).then(function () {

@@ -419,2 +420,3 @@ var library = window[globalObjectName];

globalObjectName: "gtag",
globalDataLayerName: "dataLayer",
pageTrackerEnabled: true,

@@ -421,0 +423,0 @@ pageTrackerScreenviewEnabled: false,

@@ -361,2 +361,3 @@ 'use strict';

globalObjectName = _getOptions.globalObjectName,
globalDataLayerName = _getOptions.globalDataLayerName,
id = _getOptions.config.id,

@@ -375,6 +376,6 @@ pageTrackerEnabled = _getOptions.pageTrackerEnabled,

if (window[globalObjectName] == null) {
window.dataLayer = window.dataLayer || [];
window[globalDataLayerName] = window[globalDataLayerName] || [];
window[globalObjectName] = function () {
window.dataLayer.push(arguments);
window[globalDataLayerName].push(arguments);
};

@@ -396,3 +397,3 @@ }

var domain = "https://www.googletagmanager.com";
var resource = "".concat(domain, "/gtag/js?id=").concat(id);
var resource = "".concat(domain, "/gtag/js?id=").concat(id, "&l=").concat(globalDataLayerName);
return loadScript(resource, domain).then(function () {

@@ -423,2 +424,3 @@ var library = window[globalObjectName];

globalObjectName: "gtag",
globalDataLayerName: "dataLayer",
pageTrackerEnabled: true,

@@ -425,0 +427,0 @@ pageTrackerScreenviewEnabled: false,

@@ -363,2 +363,3 @@ (function (global, factory) {

globalObjectName = _getOptions.globalObjectName,
globalDataLayerName = _getOptions.globalDataLayerName,
id = _getOptions.config.id,

@@ -377,6 +378,6 @@ pageTrackerEnabled = _getOptions.pageTrackerEnabled,

if (window[globalObjectName] == null) {
window.dataLayer = window.dataLayer || [];
window[globalDataLayerName] = window[globalDataLayerName] || [];
window[globalObjectName] = function () {
window.dataLayer.push(arguments);
window[globalDataLayerName].push(arguments);
};

@@ -398,3 +399,3 @@ }

var domain = "https://www.googletagmanager.com";
var resource = "".concat(domain, "/gtag/js?id=").concat(id);
var resource = "".concat(domain, "/gtag/js?id=").concat(id, "&l=").concat(globalDataLayerName);
return loadScript(resource, domain).then(function () {

@@ -425,2 +426,3 @@ var library = window[globalObjectName];

globalObjectName: "gtag",
globalDataLayerName: "dataLayer",
pageTrackerEnabled: true,

@@ -427,0 +429,0 @@ pageTrackerScreenviewEnabled: false,

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).VueGtag={})}(this,function(e){"use strict";function n(e){return(n="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 t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var o=function(){};function a(e,n){console.warn("[vue-gtag] "+e),n&&n.stack&&console.warn(n.stack)}function r(e){return e&&"object"===n(e)&&!Array.isArray(e)}function i(){var e,n=k().globalObjectName;"undefined"!=typeof window&&(e=window)[n].apply(e,arguments)}var c,u,f=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var o=k(),a=o.config,r=o.includes;i.apply(void 0,["config",a.id].concat(n)),Array.isArray(r)&&r.forEach(function(e){i.apply(void 0,["config",e.id].concat(n))})},p=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=k(),o=t.defaultGroupName,a=t.includes,r=n;a&&null==r.send_to&&(r.send_to=a.map(function(e){return e.id}).concat(o)),i("event",e,r)},l=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var o=n[0],a={};a="string"==typeof o?{page_path:o,page_location:window.location.href}:o,f(a)},d=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["screen_view"].concat(n))},s=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=k(),t=n.includes,o=n.config;window["ga-disable-".concat(o.id)]=e,Array.isArray(t)&&t.forEach(function(n){window["ga-disable-".concat(n.id)]=e})},g=function(){s(!0)},v={query:i,config:f,event:p,pageview:l,screenview:d,customMap:function(e){f({custom_map:e})},time:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["timing_complete"].concat(n))},exception:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["exception"].concat(n))},linker:function(e){f("linker",e)},purchase:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["purchase"].concat(n))},refund:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["refund"].concat(n))},set:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];i.apply(void 0,["set"].concat(n))},optIn:function(){s(!1)},optOut:g},y=function(){var e=T();e.$gtag=e.prototype.$gtag=v},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.path!==n.path){var t,o=k(),r=o.pageTrackerTemplate,i=o.pageTrackerScreenviewEnabled,c=o.appName,u=r(e,n);t=u||(i?{app_name:c,screen_name:e.name}:{page_title:e.name,page_path:e.path,page_location:window.location.href}),!i||t.app_name?!i||t.screen_name?i?d(t):l(t):a("To use the screenview, name your routes"):a("To use the screenview, add the appName to the plugin options")}},h=function(){var e=_();e&&function(e){var n=T(),t=k(),o=t.onBeforeTrack,a=t.onAfterTrack;e.onReady(function(t){n.nextTick().then(function(){w(t)}),e.afterEach(function(e,t){n.nextTick().then(function(){o(e,t),w(e,t),a(e,t)})})})}(e)};function m(){if("undefined"!=typeof document&&"undefined"!=typeof window){var e=k(),n=e.enabled,t=e.globalObjectName,o=e.config.id,r=e.pageTrackerEnabled,i=e.onReady,c=e.disableScriptLoad,u=_(),p=Boolean(r&&u);if(n||g(),null==window[t]&&(window.dataLayer=window.dataLayer||[],window[t]=function(){window.dataLayer.push(arguments)}),window[t]("js",new Date),p?h():f(),!c){var l="https://www.googletagmanager.com";return function(e,n){return new Promise(function(t,o){var a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("script");if(r.async=!0,r.src=e,r.charset="utf-8",n){var i=document.createElement("link");i.href=n,i.rel="preconnect",a.appendChild(i)}a.appendChild(r),r.onload=t,r.onerror=o})}("".concat(l,"/gtag/js?id=").concat(o),l).then(function(){var e=window[t];return"function"==typeof i&&i(e),e}).catch(function(e){return a("Ops! Something happened and gtag.js couldn't be loaded",e),e})}}}var b={pageTrackerTemplate:o,onBeforeTrack:o,onAfterTrack:o,onReady:o,enabled:!0,disableScriptLoad:!1,bootstrap:!0,globalObjectName:"gtag",pageTrackerEnabled:!0,pageTrackerScreenviewEnabled:!1,defaultGroupName:"default",includes:null,config:null},k=function(){return b},A=function(e){return function e(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];if(!a.length)return n;var c=a.shift();if(r(n)&&r(c)){for(var u in c)r(c[u])?(n[u]||Object.assign(n,t({},u,{})),e(n[u],c[u])):Object.assign(n,t({},u,c[u]));return e.apply(void 0,[n].concat(a))}}(b,e)},T=function(){return c},_=function(){return u};function j(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;c=e,u=t,A(n),y(),b.bootstrap&&m()}var O=m,E=A,S=v.query,x=v.config,N=v.event,L=v.pageview,B=v.screenview,M=v.customMap,q=v.time,G=v.exception,I=v.linker,P=v.purchase,R=v.set,C=v.optIn,$=v.optOut;e.bootstrap=O,e.config=x,e.customMap=M,e.default=j,e.event=N,e.exception=G,e.install=j,e.linker=I,e.optIn=C,e.optOut=$,e.pageview=L,e.purchase=P,e.query=S,e.screenview=B,e.set=R,e.setOptions=E,e.time=q,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).VueGtag={})}(this,function(e){"use strict";function n(e){return(n="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 t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var o=function(){};function a(e,n){console.warn("[vue-gtag] "+e),n&&n.stack&&console.warn(n.stack)}function r(e){return e&&"object"===n(e)&&!Array.isArray(e)}function i(){var e,n=k().globalObjectName;"undefined"!=typeof window&&(e=window)[n].apply(e,arguments)}var c,u,f=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var o=k(),a=o.config,r=o.includes;i.apply(void 0,["config",a.id].concat(n)),Array.isArray(r)&&r.forEach(function(e){i.apply(void 0,["config",e.id].concat(n))})},p=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=k(),o=t.defaultGroupName,a=t.includes,r=n;a&&null==r.send_to&&(r.send_to=a.map(function(e){return e.id}).concat(o)),i("event",e,r)},l=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var o=n[0],a={};a="string"==typeof o?{page_path:o,page_location:window.location.href}:o,f(a)},d=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["screen_view"].concat(n))},s=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=k(),t=n.includes,o=n.config;window["ga-disable-".concat(o.id)]=e,Array.isArray(t)&&t.forEach(function(n){window["ga-disable-".concat(n.id)]=e})},g=function(){s(!0)},v={query:i,config:f,event:p,pageview:l,screenview:d,customMap:function(e){f({custom_map:e})},time:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["timing_complete"].concat(n))},exception:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["exception"].concat(n))},linker:function(e){f("linker",e)},purchase:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["purchase"].concat(n))},refund:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];p.apply(void 0,["refund"].concat(n))},set:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];i.apply(void 0,["set"].concat(n))},optIn:function(){s(!1)},optOut:g},y=function(){var e=T();e.$gtag=e.prototype.$gtag=v},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.path!==n.path){var t,o=k(),r=o.pageTrackerTemplate,i=o.pageTrackerScreenviewEnabled,c=o.appName,u=r(e,n);t=u||(i?{app_name:c,screen_name:e.name}:{page_title:e.name,page_path:e.path,page_location:window.location.href}),!i||t.app_name?!i||t.screen_name?i?d(t):l(t):a("To use the screenview, name your routes"):a("To use the screenview, add the appName to the plugin options")}},m=function(){var e=_();e&&function(e){var n=T(),t=k(),o=t.onBeforeTrack,a=t.onAfterTrack;e.onReady(function(t){n.nextTick().then(function(){w(t)}),e.afterEach(function(e,t){n.nextTick().then(function(){o(e,t),w(e,t),a(e,t)})})})}(e)};function h(){if("undefined"!=typeof document&&"undefined"!=typeof window){var e=k(),n=e.enabled,t=e.globalObjectName,o=e.globalDataLayerName,r=e.config.id,i=e.pageTrackerEnabled,c=e.onReady,u=e.disableScriptLoad,p=_(),l=Boolean(i&&p);if(n||g(),null==window[t]&&(window[o]=window[o]||[],window[t]=function(){window[o].push(arguments)}),window[t]("js",new Date),l?m():f(),!u){var d="https://www.googletagmanager.com";return function(e,n){return new Promise(function(t,o){var a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("script");if(r.async=!0,r.src=e,r.charset="utf-8",n){var i=document.createElement("link");i.href=n,i.rel="preconnect",a.appendChild(i)}a.appendChild(r),r.onload=t,r.onerror=o})}("".concat(d,"/gtag/js?id=").concat(r,"&l=").concat(o),d).then(function(){var e=window[t];return"function"==typeof c&&c(e),e}).catch(function(e){return a("Ops! Something happened and gtag.js couldn't be loaded",e),e})}}}var b={pageTrackerTemplate:o,onBeforeTrack:o,onAfterTrack:o,onReady:o,enabled:!0,disableScriptLoad:!1,bootstrap:!0,globalObjectName:"gtag",globalDataLayerName:"dataLayer",pageTrackerEnabled:!0,pageTrackerScreenviewEnabled:!1,defaultGroupName:"default",includes:null,config:null},k=function(){return b},A=function(e){return function e(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];if(!a.length)return n;var c=a.shift();if(r(n)&&r(c)){for(var u in c)r(c[u])?(n[u]||Object.assign(n,t({},u,{})),e(n[u],c[u])):Object.assign(n,t({},u,c[u]));return e.apply(void 0,[n].concat(a))}}(b,e)},T=function(){return c},_=function(){return u};function j(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;c=e,u=t,A(n),y(),b.bootstrap&&h()}var O=h,E=A,N=v.query,S=v.config,x=v.event,L=v.pageview,B=v.screenview,M=v.customMap,q=v.time,D=v.exception,G=v.linker,I=v.purchase,P=v.set,R=v.optIn,C=v.optOut;e.bootstrap=O,e.config=S,e.customMap=M,e.default=j,e.event=x,e.exception=D,e.install=j,e.linker=G,e.optIn=R,e.optOut=C,e.pageview=L,e.purchase=I,e.query=N,e.screenview=B,e.set=P,e.setOptions=E,e.time=q,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.6.5",
"version": "1.7.0",
"author": {

@@ -87,3 +87,3 @@ "name": "Matteo Gabriele",

"flush-promises": "^1.0.2",
"jest": "^24.9.0",
"jest": "^26.0.1",
"prettier": "^1.19.1",

@@ -90,0 +90,0 @@ "semantic-release": "^15.13.31",

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