Comparing version 2.0.1 to 2.0.2-beta.0
@@ -307,6 +307,2 @@ import { isPlainObject, isFunction } from '@vue/shared'; | ||
if (template.send_page_view == null) { | ||
template.send_page_view = true; | ||
} | ||
event("page_view", template); | ||
@@ -313,0 +309,0 @@ }); |
@@ -311,6 +311,2 @@ 'use strict'; | ||
if (template.send_page_view == null) { | ||
template.send_page_view = true; | ||
} | ||
event("page_view", template); | ||
@@ -317,0 +313,0 @@ }); |
@@ -325,6 +325,2 @@ (function (global, factory) { | ||
if (template.send_page_view == null) { | ||
template.send_page_view = true; | ||
} | ||
event("page_view", template); | ||
@@ -331,0 +327,0 @@ }); |
@@ -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,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(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 a=null!=arguments[n]?arguments[n]:{};n%2?r(Object(a),!0).forEach((function(n){t(e,n,a[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))}))}return e}const o=e=>"function"==typeof e,i=Object.prototype.toString,c=e=>{return"[object Object]"===(n=e,i.call(n));var n};var u=function e(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(!a.length)return n;var i=a.shift();if(c(n)&&c(i)){for(var u in i)c(i[u])?(n[u]||Object.assign(n,t({},u,{})),e(n[u],i[u])):Object.assign(n,t({},u,i[u]));return e.apply(void 0,[n].concat(a))}},l=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},p=function(e){l()},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p('Missing "appName" property inside the plugin options.',null==e.app_name),p('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={},v=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)},m=function(){return g},h=function(){var e,n=m(),t=n.globalObjectName;l()&&void 0!==window[t]&&(e=window)[t].apply(e,arguments)},w=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=m(),a=r.config,o=r.includes;h.apply(void 0,["config",a.id].concat(n)),Array.isArray(o)&&o.forEach((function(e){h.apply(void 0,["config",e.id].concat(n))}))},y=function(e,n){l()&&(window["ga-disable-".concat(e)]=n)},b=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=m(),t=n.config,r=n.includes;y(t.id,e),Array.isArray(r)&&r.forEach((function(n){return y(n.id,e)}))},O=function(){b(!0)},_=function(){b(!1)},j=function(e){s=e},k=function(){return s},T=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=m(),r=t.includes,a=t.defaultGroupName;null==n.send_to&&Array.isArray(r)&&r.length&&(n.send_to=r.map((function(e){return e.id})).concat(a)),h("event",e,n)},P=function(e){if(l()){var n;if("string"==typeof e)n={page_path:e};else if(e.path||e.fullPath){var t=m(),r=t.pageTrackerUseFullPath,o=t.pageTrackerPrependBase,i=k(),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)}},E=function(e){var n,t=m().appName;e&&((n="string"==typeof e?{screen_name:e}:e).app_name=n.app_name||t,T("screen_view",n))},A=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))},N=function(e){w("linker",e)},S=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];h.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){w({custom_map:e})},B=Object.freeze({__proto__:null,query:h,config:w,optOut:O,optIn:_,pageview:P,screenview:E,exception:A,linker:N,time:S,set:R,refund:x,purchase:L,customMap:D,event:T}),M=function(e){e.config.globalProperties.$gtag=B},U=function(e){return a({send_page_view:!1},e)},q=function(){var e=m(),n=e.config,t=e.includes;h("config",n.id,U(n.params)),Array.isArray(t)&&t.forEach((function(e){h("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=m(),r=t.appName,a=t.pageTrackerTemplate,i=t.pageTrackerScreenviewEnabled,c=t.pageTrackerSkipSamePath;if(!c||e.path!==n.path){var u=e;o(a)?u=a(e,n):i&&(u=f({app_name:r,screen_name:e.name})),i?E(u):P(u)}},C=function(e){var n=m().pageTrackerExcludedRoutes;return n.includes(e.path)||n.includes(e.name)},F=function(){var e=m(),t=e.onBeforeTrack,r=e.onAfterTrack,a=k();a.isReady().then((function(){n.nextTick().then((function(){var e=a.currentRoute;q(),C(e.value)||G(e.value)})),a.afterEach((function(e,a){n.nextTick().then((function(){C(e)||(o(t)&&t(e,a),G(e,a),o(r)&&r(e,a))}))}))}))},I=function(){var e=m(),n=e.onReady,t=e.onError,r=e.globalObjectName,a=e.globalDataLayerName,o=e.config,i=e.customResourceURL,c=e.customPreconnectOrigin,u=e.deferScriptLoad,p=e.pageTrackerEnabled,f=e.disableScriptLoad,d=Boolean(p&&k());if(function(){if(l()){var e=m(),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 a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("script");if(o.async=!0,o.src=e,o.defer=n.defer,n.preconnectOrigin){var i=document.createElement("link");i.href=n.preconnectOrigin,i.rel="preconnect",a.appendChild(i)}a.appendChild(o),o.onload=t,o.onerror=r}}))}("".concat(i,"?id=").concat(o.id,"&l=").concat(a),{preconnectOrigin:c,defer:u}).then((function(){n&&n(window[r])})).catch((function(e){return t&&t(e),e}))},z=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;M(e),v(n),j(t),m().bootstrap&&I()};e.addRoutesTracker=F,e.bootstrap=I,e.config=w,e.customMap=D,e.default=z,e.event=T,e.exception=A,e.install=z,e.linker=N,e.optIn=_,e.optOut=O,e.pageview=P,e.purchase=L,e.query=h,e.refund=x,e.screenview=E,e.set=R,e.setOptions=v,e.setRouter=j,e.time=S,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,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(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 a=null!=arguments[n]?arguments[n]:{};n%2?r(Object(a),!0).forEach((function(n){t(e,n,a[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))}))}return e}const o=e=>"function"==typeof e,i=Object.prototype.toString,c=e=>{return"[object Object]"===(n=e,i.call(n));var n};var u=function e(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];if(!a.length)return n;var i=a.shift();if(c(n)&&c(i)){for(var u in i)c(i[u])?(n[u]||Object.assign(n,t({},u,{})),e(n[u],i[u])):Object.assign(n,t({},u,i[u]));return e.apply(void 0,[n].concat(a))}},l=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},p=function(e){l()},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p('Missing "appName" property inside the plugin options.',null==e.app_name),p('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={},v=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)},m=function(){return g},h=function(){var e,n=m(),t=n.globalObjectName;l()&&void 0!==window[t]&&(e=window)[t].apply(e,arguments)},w=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=m(),a=r.config,o=r.includes;h.apply(void 0,["config",a.id].concat(n)),Array.isArray(o)&&o.forEach((function(e){h.apply(void 0,["config",e.id].concat(n))}))},y=function(e,n){l()&&(window["ga-disable-".concat(e)]=n)},b=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=m(),t=n.config,r=n.includes;y(t.id,e),Array.isArray(r)&&r.forEach((function(n){return y(n.id,e)}))},O=function(){b(!0)},j=function(){b(!1)},k=function(e){s=e},_=function(){return s},T=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=m(),r=t.includes,a=t.defaultGroupName;null==n.send_to&&Array.isArray(r)&&r.length&&(n.send_to=r.map((function(e){return e.id})).concat(a)),h("event",e,n)},P=function(e){if(l()){var n;if("string"==typeof e)n={page_path:e};else if(e.path||e.fullPath){var t=m(),r=t.pageTrackerUseFullPath,o=t.pageTrackerPrependBase,i=_(),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),T("page_view",n)}},E=function(e){var n,t=m().appName;e&&((n="string"==typeof e?{screen_name:e}:e).app_name=n.app_name||t,T("screen_view",n))},A=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))},N=function(e){w("linker",e)},S=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];h.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){w({custom_map:e})},B=Object.freeze({__proto__:null,query:h,config:w,optOut:O,optIn:j,pageview:P,screenview:E,exception:A,linker:N,time:S,set:R,refund:x,purchase:L,customMap:D,event:T}),M=function(e){e.config.globalProperties.$gtag=B},U=function(e){return a({send_page_view:!1},e)},q=function(){var e=m(),n=e.config,t=e.includes;h("config",n.id,U(n.params)),Array.isArray(t)&&t.forEach((function(e){h("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=m(),r=t.appName,a=t.pageTrackerTemplate,i=t.pageTrackerScreenviewEnabled,c=t.pageTrackerSkipSamePath;if(!c||e.path!==n.path){var u=e;o(a)?u=a(e,n):i&&(u=f({app_name:r,screen_name:e.name})),i?E(u):P(u)}},C=function(e){var n=m().pageTrackerExcludedRoutes;return n.includes(e.path)||n.includes(e.name)},F=function(){var e=m(),t=e.onBeforeTrack,r=e.onAfterTrack,a=_();a.isReady().then((function(){n.nextTick().then((function(){var e=a.currentRoute;q(),C(e.value)||G(e.value)})),a.afterEach((function(e,a){n.nextTick().then((function(){C(e)||(o(t)&&t(e,a),G(e,a),o(r)&&r(e,a))}))}))}))},I=function(){var e=m(),n=e.onReady,t=e.onError,r=e.globalObjectName,a=e.globalDataLayerName,o=e.config,i=e.customResourceURL,c=e.customPreconnectOrigin,u=e.deferScriptLoad,p=e.pageTrackerEnabled,f=e.disableScriptLoad,d=Boolean(p&&_());if(function(){if(l()){var e=m(),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 a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("script");if(o.async=!0,o.src=e,o.defer=n.defer,n.preconnectOrigin){var i=document.createElement("link");i.href=n.preconnectOrigin,i.rel="preconnect",a.appendChild(i)}a.appendChild(o),o.onload=t,o.onerror=r}}))}("".concat(i,"?id=").concat(o.id,"&l=").concat(a),{preconnectOrigin:c,defer:u}).then((function(){n&&n(window[r])})).catch((function(e){return t&&t(e),e}))},z=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;M(e),v(n),k(t),m().bootstrap&&I()};e.addRoutesTracker=F,e.bootstrap=I,e.config=w,e.customMap=D,e.default=z,e.event=T,e.exception=A,e.install=z,e.linker=N,e.optIn=j,e.optOut=O,e.pageview=P,e.purchase=L,e.query=h,e.refund=x,e.screenview=E,e.set=R,e.setOptions=v,e.setRouter=k,e.time=S,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": "2.0.1", | ||
"version": "2.0.2-beta.0", | ||
"author": { | ||
@@ -14,10 +14,3 @@ "name": "Matteo Gabriele", | ||
}, | ||
"release": { | ||
"branches": [ | ||
"master", | ||
"next" | ||
] | ||
}, | ||
"scripts": { | ||
"commit": "git-cz", | ||
"clean": "del-cli dist", | ||
@@ -35,10 +28,4 @@ "prebuild": "yarn clean", | ||
"coverage:lcov": "TZ=UTC jest --coverage --coverageReporters=lcov", | ||
"prepublishOnly": "TZ=UTC yarn lint && yarn test && yarn build", | ||
"semantic-release": "semantic-release" | ||
"prepublishOnly": "TZ=UTC yarn lint && yarn test && yarn build" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"jest": { | ||
@@ -97,5 +84,3 @@ "setupFiles": [ | ||
"bili": "^5.0.5", | ||
"commitizen": "^4.0.3", | ||
"core-js": "^3.10.1", | ||
"cz-conventional-changelog": "^3.0.2", | ||
"del-cli": "^3.0.0", | ||
@@ -115,3 +100,2 @@ "eslint": "^6.6.0", | ||
"rollup-plugin-resolve": "^0.0.1-predev.1", | ||
"semantic-release": "^15.13.31", | ||
"vue": "^3.0.0", | ||
@@ -118,0 +102,0 @@ "vue-router": "^4.0.6", |
@@ -1,4 +0,2 @@ | ||
🔥 **HEADS UP!** This is version 2 branch and it requires Vue 3. If you are looking for a Vue 2 compatible version, use [version 1](https://github.com/MatteoGabriele/vue-gtag/tree/1.0). You can find both documentations [here](https://matteo-gabriele.gitbook.io/vue-gtag/) | ||
<p align="center"> | ||
@@ -40,3 +38,3 @@ <img width="250" src="https://i.imgur.com/AlAf04U.png"> | ||
```bash | ||
npm install vue-gtag@next | ||
npm install vue-gtag | ||
``` | ||
@@ -43,0 +41,0 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
22
108470
1779
2
57