@gtm-support/vue-gtm
Advanced tools
Comparing version 2.2.0 to 3.0.0
@@ -24,2 +24,2 @@ import { GtmSupport, GtmSupportOptions } from '@gtm-support/core'; | ||
export { VueGtmPlugin, VueGtmUseOptions, createGtm, _default as default, useGtm }; | ||
export { type VueGtmPlugin, type VueGtmUseOptions, createGtm, _default as default, useGtm }; |
@@ -1,2 +0,2 @@ | ||
import{GtmSupport as g,loadScript as m}from"@gtm-support/core";import{nextTick as y}from"vue";import{GtmSupport as T,assertIsGtmId as b,hasScript as I,loadScript as k}from"@gtm-support/core";var i;function c(a,t={id:""}){t={trackOnNextTick:!1,...t},i=new g(t),a.config.globalProperties.$gtm=i,i.isInBrowserContext()&&(t.vueRouter&&G(a,t.vueRouter,t.ignoredViews,t.trackOnNextTick,t.vueRouterAdditionalEventData),i.options.enabled&&i.options.loadScript&&(Array.isArray(t.id)?t.id.forEach(r=>{if(typeof r=="string")m(r,t);else{let n={...t};r.queryParams!=null&&(n.queryParams={...n.queryParams,...r.queryParams}),m(r.id,n)}}):m(t.id,t))),a.provide("gtm",t)}function G(a,t,r=[],n,f=()=>({})){function l(e,u){return e instanceof Error?!!(e.type&u):!1}t.afterEach(async(e,u,p)=>{if(typeof e.name!="string"||Array.isArray(r)&&r.includes(e.name)||typeof r=="function"&&r(e,u))return;let s=e.meta&&typeof e.meta.gtm=="string"&&e.meta.gtm?e.meta.gtm:e.name;l(p,4)?i?.debugEnabled()&&console.log(`[VueGtm]: '${s}' not tracked due to navigation aborted`):l(p,8)&&i?.debugEnabled()&&console.log(`[VueGtm]: '${s}' not tracked due to navigation cancelled`);let d={...await f(e,u),...e.meta?.gtmAdditionalEventData},o=t.options?.history?.base??"";o.endsWith("/")||(o+="/"),o+=e.fullPath.startsWith("/")?e.fullPath.substring(1):e.fullPath,n?y(()=>{i?.trackView(s,o,d)}):i?.trackView(s,o,d)})}function N(a){return{install:t=>c(t,a)}}var v={install:c};var V=v;function E(){return i}export{g as GtmPlugin,T as GtmSupport,b as assertIsGtmId,N as createGtm,V as default,I as hasScript,k as loadScript,E as useGtm}; | ||
import{GtmSupport as f,loadScript as m}from"@gtm-support/core";import{getCurrentInstance as y,nextTick as G}from"vue";import{GtmSupport as b,assertIsGtmId as I,hasScript as k,loadScript as L}from"@gtm-support/core";var i;function c(a,t={id:""}){t={trackOnNextTick:!1,...t},i=new f(t),a.config.globalProperties.$gtm=i,i.isInBrowserContext()&&(t.vueRouter&&v(a,t.vueRouter,t.ignoredViews,t.trackOnNextTick,t.vueRouterAdditionalEventData),i.options.enabled&&i.options.loadScript&&(Array.isArray(t.id)?t.id.forEach(r=>{if(typeof r=="string")m(r,t);else{let n={...t};r.queryParams!=null&&(n.queryParams={...n.queryParams,...r.queryParams}),m(r.id,n)}}):m(t.id,t))),a.provide("gtm",t)}function v(a,t,r=[],n,g=()=>({})){function p(e,u){return e instanceof Error?!!(e.type&u):!1}t.afterEach(async(e,u,l)=>{if(typeof e.name!="string"||Array.isArray(r)&&r.includes(e.name)||typeof r=="function"&&r(e,u))return;let s=e.meta&&typeof e.meta.gtm=="string"&&e.meta.gtm?e.meta.gtm:e.name;p(l,4)?i?.debugEnabled()&&console.log(`[VueGtm]: '${s}' not tracked due to navigation aborted`):p(l,8)&&i?.debugEnabled()&&console.log(`[VueGtm]: '${s}' not tracked due to navigation cancelled`);let d={...await g(e,u),...e.meta?.gtmAdditionalEventData},o=t.options?.history?.base??"";o.endsWith("/")||(o+="/"),o+=e.fullPath.startsWith("/")?e.fullPath.substring(1):e.fullPath,n?G(()=>{i?.trackView(s,o,d)}):i?.trackView(s,o,d)})}function V(a){return{install:t=>c(t,a)}}var O={install:c};var E=O;function R(){return y()?.appContext?.app?.config?.globalProperties?.$gtm??i}export{f as GtmPlugin,b as GtmSupport,I as assertIsGtmId,V as createGtm,E as default,k as hasScript,L as loadScript,R as useGtm}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@gtm-support/vue-gtm", | ||
"version": "2.2.0", | ||
"version": "3.0.0", | ||
"description": "Simple implementation of Google Tag Manager for Vue", | ||
"scripts": { | ||
"clean": "rimraf coverage .eslintcache dist pnpm-lock.yaml node_modules", | ||
"build:clean": "rimraf dist", | ||
"build:code": "tsup-node", | ||
"build": "run-s build:clean build:code", | ||
"format": "prettier --cache --write .", | ||
"lint": "eslint --cache --cache-strategy content --report-unused-disable-directives .", | ||
"ts-check": "tsc", | ||
"test": "vitest", | ||
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build", | ||
"preflight": "pnpm install && run-s format lint build test ts-check" | ||
}, | ||
"type": "module", | ||
@@ -21,9 +9,5 @@ "files": [ | ||
], | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"default": "./dist/index.js" | ||
}, | ||
".": "./dist/index.js", | ||
"./package.json": "./package.json" | ||
@@ -71,23 +55,24 @@ }, | ||
"dependencies": { | ||
"@gtm-support/core": "^2.0.0" | ||
"@gtm-support/core": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "~6.7.2", | ||
"@typescript-eslint/parser": "~6.7.2", | ||
"eslint": "~8.49.0", | ||
"eslint-config-prettier": "~9.0.0", | ||
"eslint-define-config": "~1.23.0", | ||
"@types/node": "~20.12.12", | ||
"@typescript-eslint/eslint-plugin": "~7.10.0", | ||
"@typescript-eslint/parser": "~7.10.0", | ||
"eslint": "~8.57.0", | ||
"eslint-config-prettier": "~9.1.0", | ||
"eslint-define-config": "~2.1.0", | ||
"eslint-gitignore": "~0.1.0", | ||
"eslint-plugin-jsdoc": "~46.8.2", | ||
"eslint-plugin-prettier": "~5.0.0", | ||
"eslint-plugin-jsdoc": "~48.2.6", | ||
"eslint-plugin-prettier": "~5.1.3", | ||
"eslint-plugin-spellcheck": "~0.0.20", | ||
"jsdom": "~22.1.0", | ||
"npm-run-all": "~4.1.5", | ||
"prettier": "3.0.3", | ||
"prettier-plugin-organize-imports": "~3.2.3", | ||
"rimraf": "~5.0.1", | ||
"tsup": "~7.2.0", | ||
"typescript": "~5.2.2", | ||
"vitest": "~0.34.5", | ||
"vue": "^3.3.4", | ||
"jsdom": "~24.1.0", | ||
"npm-run-all2": "~6.2.0", | ||
"prettier": "3.2.5", | ||
"prettier-plugin-organize-imports": "~3.2.4", | ||
"rimraf": "~5.0.7", | ||
"tsup": "~8.0.2", | ||
"typescript": "~5.4.5", | ||
"vitest": "~1.6.0", | ||
"vue": "^3.4.15", | ||
"vue-router": "^4.2.5" | ||
@@ -106,3 +91,13 @@ }, | ||
}, | ||
"packageManager": "pnpm@8.7.6" | ||
} | ||
"scripts": { | ||
"clean": "rimraf coverage .eslintcache dist pnpm-lock.yaml node_modules", | ||
"build:clean": "rimraf dist", | ||
"build:code": "tsup-node", | ||
"build": "run-s build:clean build:code", | ||
"format": "prettier --cache --write .", | ||
"lint": "eslint --cache --cache-strategy content --report-unused-disable-directives .", | ||
"ts-check": "tsc", | ||
"test": "vitest", | ||
"preflight": "pnpm install && run-s format lint build test ts-check" | ||
} | ||
} |
<h1 align="center">Vue Google Tag Manager</h1> | ||
<h4 align="center">*** Contributors welcome ***</h4> | ||
<p align="center"> | ||
@@ -20,3 +18,3 @@ <a href="https://tagmanager.google.com/"> | ||
<a href="https://github.com/gtm-support/vue-gtm/blob/main/LICENSE"> | ||
<img alt="license: Apache-2.0" src="https://img.shields.io/github/license/gtm-support/vue-gtm.svg?style=flat-square"> | ||
<img alt="license: MIT" src="https://img.shields.io/github/license/gtm-support/vue-gtm.svg?style=flat-square"> | ||
</a> | ||
@@ -41,4 +39,2 @@ <a href="https://www.npmjs.com/package/@gtm-support/vue-gtm"> | ||
> If you want Vue 2 compatibility, please use the package [@gtm-support/vue2-gtm](https://www.npmjs.com/package/@gtm-support/vue2-gtm). | ||
# Requirements | ||
@@ -55,3 +51,3 @@ | ||
`npm install @gtm-support/vue-gtm` or `yarn add @gtm-support/vue-gtm` if you use [Yarn package manager](https://yarnpkg.com) | ||
`npm install @gtm-support/vue-gtm` | ||
@@ -299,7 +295,2 @@ Here is an example configuration: | ||
## IE 11 support | ||
If you really need to support browsers like IE 11, you need to configure `transpileDependencies: ['@gtm-support/core']` in your `vue.config.js`. | ||
See [gtm-support/core#20 (comment)](https://github.com/gtm-support/core/issues/20#issuecomment-855903062) | ||
## Credits | ||
@@ -306,0 +297,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
24979
20
6
28
296
+ Added@gtm-support/core@3.0.1(transitive)
- Removed@gtm-support/core@2.3.1(transitive)
Updated@gtm-support/core@^3.0.1