zadigetvoltaire / nuxt-gtm

Nuxt 3 module for Google Tag Manager
https://www.npmjs.com/package/@zadigetvoltaire/nuxt-gtm
MIT License
70 stars 4 forks source link

Cannot use vueRouterAdditionalEventData option #27

Open dovca opened 8 months ago

dovca commented 8 months ago

It is currently impossible to use the vueRouterAdditionalEventData option, because it is stored in public runtime config by the plugin and removed during serialization for the client bundle (see https://nuxt.com/docs/guide/going-further/runtime-config#serialization)

Reproduction:

// nuxt.config.ts

gtm: {
  vueRouterAdditionalEventData: () => ({foo: 'bar'});
}

Result:

The additional data is not added to the trackView event payload

AdrianFahrbach commented 3 months ago

Got the same issue. Any updates on this?