Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions strr-base-web/app/plugins/gtm.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createGtm } from '@gtm-support/vue-gtm'

export default defineNuxtPlugin((nuxtApp) => {
const { enableRouterSync, ...options } = useRuntimeConfig().public.gtm

nuxtApp.vueApp.use(createGtm({
...options,
vueRouter: enableRouterSync ? useRouter() : undefined
}))
})
15 changes: 7 additions & 8 deletions strr-base-web/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default defineNuxtConfig({
'@nuxtjs/eslint-module',
'@nuxt/test-utils/module',
'@nuxt/image',
'@zadigetvoltaire/nuxt-gtm',
'nuxt-gtag'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this module removed from this list?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was removed because this module only supports nuxt 3. for nuxt 4 we now use the same tracking package directly, so the setup stays the same without relying on the old module.

],

Expand Down Expand Up @@ -84,13 +83,6 @@ export default defineNuxtConfig({
fallback: 'light'
},

gtm: {
enabled: isGtmEnabled,
id: isGtmEnabled ? process.env.NUXT_GTM_ID?.trim() as string : 'GTM-UNDEFINED',
debug: true,
defer: true
},

gtag: {
enabled: !!process.env.NUXT_GTAG_ID?.trim(),
id: process.env.NUXT_GTAG_ID?.trim()
Expand All @@ -99,6 +91,13 @@ export default defineNuxtConfig({
runtimeConfig: {
public: {
// Keys within public, will be also exposed to the client-side
gtm: {
enabled: isGtmEnabled,
id: isGtmEnabled ? process.env.NUXT_GTM_ID?.trim() as string : 'GTM-UNDEFINED',
debug: true,
defer: true,
enableRouterSync: true
},
addressCompleteKey: process.env.NUXT_ADDRESS_COMPLETE_KEY,
payApiURL: `${process.env.NUXT_PAY_API_URL}${process.env.NUXT_PAY_API_VERSION}`,
legalApiURL: `${process.env.NUXT_LEGAL_API_URL}${process.env.NUXT_LEGAL_API_VERSION}`,
Expand Down
12 changes: 6 additions & 6 deletions strr-base-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"devDependencies": {
"@axe-core/playwright": "^4.9.1",
"@nuxt/devtools": "^3.1.1",
"@nuxt/devtools": "3.4.1",
"@nuxt/image": "^2.0.0",
"@nuxt/test-utils": "^3.21.0",
"@nuxt/test-utils": "4.1.0",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@nuxtjs/eslint-module": "^4.1.0",
"@pinia/testing": "^1.0.3",
Expand All @@ -34,21 +34,21 @@
"@types/luxon": "^3.4.2",
"@types/uuid": "^10.0.0",
"@typescript-eslint/parser": "^8.19.0",
"@vitest/coverage-v8": "3.2.4",
"@vitest/coverage-v8": "4.1.11",
"@vue/test-utils": "^2.4.6",
"eslint": "^8.57.1",
"eslint-plugin-tailwindcss": "^3.17.4",
"happy-dom": "^20.0.11",
"nuxt": "3.15.4",
"nuxt": "4.5.2",
"playwright-core": "^1.57.0",
"sass": "^1.77.6",
"typescript": "^5.9.3",
"vitest": "^3.2.4"
"vitest": "4.1.11"
},
"dependencies": {
"@daxiom/nuxt-core-layer-test": "^0.0.29",
"@vuepic/vue-datepicker": "^10.0.0",
"@zadigetvoltaire/nuxt-gtm": "^0.0.13",
"@gtm-support/vue-gtm": "3.2.0",
"country-codes-list": "^2.0.0",
"luxon": "^3.5.0",
"nuxt-gtag": "^3.0.3",
Expand Down
Loading
Loading