gtm-support/vue-gtm

Documentation improvement: gtmAdditionalEventData

ajuvonen opened this issue ยท 4 comments

Request / Idea: Improved documentation for route.meta.gtmAdditionalEventData

Adding extra properties to page view events is not documented, but support for it exists. By defining meta.gtmAdditionalEventData for a route, you can have additional properties sent along with the event. For our project this was an important discovery because we distinguish events from different environments through an additional property.

If this feature is not deprecated, I request that you improve the README.md regarding the proper use of this feature.

Additional Context

const additionalEventData: Record<string, any> = (to.meta?.gtmAdditionalEventData as Record<string, any>) ?? {};

https://github.com/gtm-support/core/blob/687524ae88b6efa11644181f6709799dce713726/src/gtm-support.ts#L161

It's not deprecated. Feel free to open a PR and I will review it ๐Ÿ™‚

@ajuvonen @Shinigami92 How can I check the parameters sent on the Analytics dashboard?

@ajuvonen @Shinigami92 How can I check the parameters sent on the Analytics dashboard?

Sadly I'm not sure, I never used the Analytics on my own and just used this plugin as a developer to set it up.
I'm also now working in a new company and we don't use this plugin there or any kind of analytics right now there, so I don't use it myself anymore.
But I'm still alive ๐Ÿ˜‰ and can help to maintain this repo via PR reviews ๐Ÿ™‚

I no longer have credentials to the customer environment where we had implemented features based on this, so unfortunately I can't be of further assistance @ebisbe. I can only say in brief that we used the gtmAdditionalEventData to send an extra environment property as part of events, which we then used to direct events to different analysis buckets through Analytics configuration.