johannschopplich / nuxt-gtag

🔸 Google Analytics & Ads integration made easy
https://developers.google.com/tag-platform/gtagjs
MIT License
302 stars 9 forks source link

No hits were sent by this tag #74

Closed robsonsobral closed 2 months ago

robsonsobral commented 5 months ago

Environment

Reproduction

Load a gTag using an ENV variable and a second one using initialize().

const { initialize } = useGtag();

  if (!import.meta.dev && import.meta.client) {
    if (campaign.value.google_analytics) {
      initialize(campaign.value.google_analytics);
    }
  }

Describe the bug

The second tag ID hasn't its events track.

image

Additional context

No response

Logs

No response

johannschopplich commented 5 months ago

Hi there, sorry, but I can't reproduce this with the latest verion of Nuxt Gtag. Can you please upgrade to the latest version v2.0.6?

robsonsobral commented 5 months ago

Thank you, @johannschopplich !

I updated, but… Still no luck.

I tried to delay both and the second still doesn't work. So, I tried to change the order and I've got the same error. As, in my case, the second is more important, I removed the first one, set using ENV variables, and kept the one that uses initialize().

May I ask if the IDs you used for your tests are from different Google Accounts? Maybe the issue is there. Or all the IDs need to be initialized at the same time... I don't know...

johannschopplich commented 5 months ago

I haven't tried the behavior with Google IDs from different accounts. Maybe they require some other handling, I'm not sure… Reproduction much appreciated!

johannschopplich commented 2 months ago

Closing this, as no reproduction was provided. If the problem persists, please open a new issue with a reproduction attached. Thanks! 🙏