Gatsby: Can I use multiple Google Tag Manager Ids with gatsby-plugin-google-tagmanager?

Created on 11 Dec 2018  路  3Comments  路  Source: gatsbyjs/gatsby

Hi all,

I would like to use multiple Tag Manager ids in my project.
Is there any possible way to achieve this with _gatsby-plugin-google-tagmanager_ plugin?

Many thanks,
David

Most helpful comment

You should be able to put 2 (or more) separate instances of the plugin with different id in your gatsby-config:

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-google-tagmanager`,
    options: {
      id: "id1",
    },
  },
  {
    resolve: `gatsby-plugin-google-tagmanager`,
    options: {
      id: "id2",
    },
  },
]

All 3 comments

You should be able to put 2 (or more) separate instances of the plugin with different id in your gatsby-config:

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-google-tagmanager`,
    options: {
      id: "id1",
    },
  },
  {
    resolve: `gatsby-plugin-google-tagmanager`,
    options: {
      id: "id2",
    },
  },
]

Well, that actually worked 馃憤 Thanks

Going to close this then 馃槉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  路  3Comments

ferMartz picture ferMartz  路  3Comments

totsteps picture totsteps  路  3Comments

benstr picture benstr  路  3Comments

jimfilippou picture jimfilippou  路  3Comments