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

Not working? #2

Open
rickbsgu opened this issue Jul 18, 2022 · 1 comment
Open

Not working? #2

rickbsgu opened this issue Jul 18, 2022 · 1 comment

Comments

@rickbsgu
Copy link

I've implemented this in dual-tagging mode behind the Universal mode plugin: "@gridsome/plugin-google-analytics": "^0.1.2"

Getting data in the universal mode, not in the GA- mode.

Here's my config settings for both plugins:

    {
      use: '@gridsome/plugin-google-analytics',
      options: {
        id: 'UA-XXXXXXXXXX-X'
      }
    },
    {
      use: 'gridsome-plugin-gtag',
      options: {
        id: 'G-XXXXXXXXXX'
      }
    },

I've grep'ed the G- tag in the generated app-XXXX.js file and it is there, right behind the UA tag. So, seems like it's in the js and ought to work.

Watching it - is there any issue with running it in dual-tagging mode?

@marcvangend
Copy link
Owner

First of all, gridsome-plugin-gtag is very thin a wrapper around vue-gtag. Everything that is supported should be documented in the documentation over there.

Second, using those plugins simultaneously is beyond the intended use case of gridsome-plugin-gtag. @gridsome/plugin-google-analytics is a wrapper around vue-analytics, which has been deprecated for more than a year now, so supporting this dual setup (if that's the problem) is not a priority for me.

That said, your options object looks like this:

{
  id: 'G-XXXXXXXXXX'
}

but the documentation for this plugin says it should look like this:

{
  config: { id: "UA-XXXXXXXXX-X" },
}

Maybe changing that is all it takes to get it working the way you want it, but I cannot promise anything.

Another thought: You could also try using only gridsome-plugin-gtag and implementing both analytics ID's with a configuration as documented in Multiple domain tracking.

If you find a setup that works for your use case, please let us know!

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

No branches or pull requests

2 participants