@dargmuesli/nuxt-vio 1.1.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/nuxt.config.ts +3 -0
- package/package.json +2 -1
- package/plugins/gtag.client.ts +18 -0
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dargmuesli/nuxt-vio",
|
3
|
-
"version": "1.1
|
3
|
+
"version": "1.2.1",
|
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
|
],
|
@@ -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
|
+
})
|