Update GTM Configuration and Dependencies

- Added a new `enabled` property to the GTM configuration in `gtm.js`, allowing for conditional enabling of the GTM plugin.
- Updated the `package-lock.json` to include the latest versions of `@gtm-support/vue-gtm` and `@gtm-support/core`, ensuring compatibility and access to new features.
- Modified the `onMounted` lifecycle hook in `FeatureBase.vue` to include a check for the `user` state, preventing script loading when the user is not available.

These changes aim to enhance the GTM integration by providing more control over its activation and ensuring that the latest dependencies are utilized for improved functionality.
This commit is contained in:
JhumanJ
2025-05-19 15:54:35 +02:00
parent 1c26e282c5
commit 1b67cd808b
4 changed files with 72 additions and 14 deletions

View File

@@ -54,7 +54,7 @@ const setupForUser = () => {
}
onMounted(() => {
if (import.meta.server) return
if (import.meta.server || !user.value) return
// Setup base
if (
@@ -66,7 +66,6 @@ onMounted(() => {
}
}
if (!user.value) return
loadScript()
try {
setupForUser()