@dargmuesli/nuxt-vio 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +6 -3
- package/plugins/gtag.client.ts +18 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dargmuesli/nuxt-vio",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.2",
|
4
4
|
"type": "module",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -12,6 +12,7 @@
|
|
12
12
|
"files": [
|
13
13
|
"composables",
|
14
14
|
"server",
|
15
|
+
"plugins",
|
15
16
|
"utils",
|
16
17
|
"nuxt.config.ts"
|
17
18
|
],
|
@@ -23,11 +24,13 @@
|
|
23
24
|
"preview": "nuxi preview .playground",
|
24
25
|
"lint": "eslint ."
|
25
26
|
},
|
27
|
+
"dependencies": {
|
28
|
+
"vue-gtag": "2.0.1"
|
29
|
+
},
|
26
30
|
"devDependencies": {
|
27
31
|
"@nuxtjs/eslint-config-typescript": "12.0.0",
|
28
32
|
"eslint": "8.37.0",
|
29
33
|
"nuxt": "3.3.3",
|
30
|
-
"typescript": "5.0.3"
|
31
|
-
"vue-gtag": "2.0.1"
|
34
|
+
"typescript": "5.0.3"
|
32
35
|
}
|
33
36
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import VueGtag from 'vue-gtag'
|
2
|
+
|
3
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
4
|
+
const config = useRuntimeConfig()
|
5
|
+
const router = useRouter()
|
6
|
+
const cookieControl = useCookieControl()
|
7
|
+
|
8
|
+
nuxtApp.vueApp.use(
|
9
|
+
VueGtag,
|
10
|
+
{
|
11
|
+
bootstrap: !!cookieControl.cookiesEnabledIds.value?.includes('ga'),
|
12
|
+
config: {
|
13
|
+
id: config.public.googleAnalyticsId,
|
14
|
+
},
|
15
|
+
},
|
16
|
+
router
|
17
|
+
)
|
18
|
+
})
|