feat: added ability to change tagmanager and analytics script src#408
feat: added ability to change tagmanager and analytics script src#408Reyno-Skeps wants to merge 4 commits intonuxt:mainfrom
Conversation
|
@Reyno-Skeps is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi, thanks for your work on this. I'm not sure if this is the best solution as there's already a property for overriding the source You mention that you don't want to define the // this should just work but I guess isn't
googleTagManager: {
scriptInput: {
src: 'https://gtm.example.com/gtm.js?id=GTM-123456',
},
},As Nuxt Scripts is focused on improving end-user performance, server-side tagging should be a first-class feature. I'd like to make sure that's the case but I haven't used it personally. As far as I can tell it's just configuring the gtag('config', 'TAG_ID', {
server_container_url: 'https://analytics.example.com',
});Happy to work with you on this and get it moved along if you can provide some insights 🙏 |
|
Closing this in favour of #500 |
feat: added ability to change tagmanager and analytics script src
🔗 Linked issue
Resolves #404
❓ Type of change
📚 Description
Currently, there is no way to change the src of the tag manager script without losing the ability of the id being appended automatically. Changing the src is necessary for server side tagging to work.
This PR adds a new option to the tag manager (and analytics) options to change the src directly. This keeps the current functionality intact while allowing a custom src.