3

I have an issue with plugin-google-analytics https://github.com/gridsome/gridsome/blob/master/packages/plugin-google-analytics/README.md

when i put my Google Analytics tracking Id in gridsome.config.js it do nothing on Google Analytics plateform. Same after two days. i upload all my files on server but never show up.. What i missed?

module.exports = {
siteName: 'massivemedias',
plugins: [
{
  use: '@gridsome/plugin-google-analytics',
  options: {
    id: 'G-NNQ12FXXX' //my tracking id
  }
}
]
}
oguz ismail
  • 1
  • 16
  • 47
  • 69

1 Answers1

6

That plugin you mentioned works with the Universal version of Google Analytics (which is what has the ids in the format UA-XXXXXXXXX-X), like the example in your link:

module.exports = {
  plugins: [
    {
      use: '@gridsome/plugin-google-analytics',
      options: {
        id: 'UA-XXXXXXXXX-X' // <-- Universal Analytics tracking ID
      }
    }
  ]
}

The code you entered in the example, G-NNQ12FXXX, refers to the new Google Analytics 4 which, being a different system from the previous one and does not work (yet) with that plugin.

So I suggest you to create a Universal Analytics type Property and use its ID (UA-XXXXX-X) with the plugin you indicated. You can find it by clicking on Show advanced options (when you create a new property):

enter image description here

Michele Pisani
  • 13,567
  • 3
  • 25
  • 42