Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Module Listing Request]: gtag #939

Open
DamianGlowala opened this issue Apr 19, 2024 · 6 comments
Open

[Module Listing Request]: gtag #939

DamianGlowala opened this issue Apr 19, 2024 · 6 comments

Comments

@DamianGlowala
Copy link
Member

DamianGlowala commented Apr 19, 2024

Description

This module provides Google Tag integration.

Repository

https://github.com/johannschopplich/nuxt-gtag

npm

https://www.npmjs.com/package/nuxt-gtag

Nuxt Compatibility

Nuxt 3

@johannschopplich
Copy link
Contributor

@DamianGlowala Thanks a lot! Your preparation steps (and PRs) are amazing.

Copy link
Member

Atinux commented May 3, 2024

I would love to see the difference or how we can find a way to collaborate with the upcoming https://scripts.nuxt.com/scripts/tracking/google-tag-manager

As I never used GTag, your feedback is welcome 😊

@johannschopplich
Copy link
Contributor

Great question!

Technically, a Google Tag ID is different from a Google Tag Manager. They are primarily used for analytics. While they can be embedded in the Google Tag Manager, the latter contains much more JS, which may be too much for simple analytics purposes.

Nuxt Gtag provides fine-grained options for working with multiple Google Tag IDs (for example, in admin panels where the preferred ID is only known after login), shortcuts like enableAnalytics, composables like useTrackEvent, and GDPR-related options.

It's a more opiniated approach than a generic useGoogleTagManager composable. That's why I'm not sure if it fits into the Nuxt Scripts approach. 🤔

@danielroe
Copy link
Member

I think we'd love to see this here. It's a solid module and you're a good maintainer. But I want to be cautious about adding a community plugin in the days immediately before we launch Nuxt Scripts, particularly if this is something Nuxt Scripts will end up doing out of the box. Mostly, because it would be annoying for you. (If it's something that will add to what Nuxt Scripts does, then that's great!)

Might be worth putting on pause until Nuxt Scripts is released, at least.

cc: @harlan-zw

@johannschopplich
Copy link
Contributor

Sounds like a good plan. Let's wait for Nuxt Scripts. Maybe I can then write a migration path for Nuxt Gtag users.

@harlan-zw
Copy link
Contributor

harlan-zw commented May 3, 2024

This is a fantastic module and has captured a lot of the issues that Nuxt Scripts has also tried to solve for all scripts.

I think there could be scope for this module to exist with Nuxt Scripts but it would need to solve some GA specific DX issues that Nuxt Scripts isn't already solving. Some of which it is already doing:

  • initCommands
  • simplifying google consent
  • useTrackEvent

The APIs for nuxt/scripts (you should already have access) are pretty much complete with just documentation and testing remaining, any feedback you have in terms of how it and this module can work together would be appreciated.

Would be especially interested to hear your thoughts on your module building on top of the Nuxt Scripts useScriptGoogleAnalytics() composable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants