Gatsby: Support for App + Web property Google Analytics Measurement ID in gatsby-plugin-google-tagmanager

Created on 28 Jun 2020  路  7Comments  路  Source: gatsbyjs/gatsby

Summary

I'm not sure if I'm setting this up correctly but I know my gatsby-plugin-google-tagmanager has a problem when I load the measurement id as in the picture below as a tag, it's not returning data from the production build even with the same gatsby-route-change trigger in the tag configuration.

I'm not sure if there is support yet, since this is still a beta (see links below for reference). But we wanted to explore this option as it would be great to make use of the extended features it offers now. Any help would be greatly appreciated to understand this better, or we could just switch back to tracking id from google analytics, which worked with the plugin.

Upgrade to an App + Web property | Google Support

What happened to my Tracking ID? | Google Support

Relevant information

Google Analytics Web Streams

image

image

Google Tag Manager Config

image

File contents

gatsby-config.js:

{
      resolve: `gatsby-plugin-google-tagmanager`,
      options: {
        id: process.env.GOOGLE_TAGMANAGER_ID,
        includeInDevelopment: false,
        defaultDataLayer: { platform: "gatsby" },
      },
    },
stale? question or discussion

Most helpful comment

Google Analytics 4 is now out of public beta. Anyone got any ideas if this is fixed?

All 7 comments

Any progress on this?

Since this is in Beta the current plugins and their script tags they add to the HTML don't support that. Feel free to send in a PR or copy the plugin code into your project and update the script tag itself.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 60 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Google Analytics 4 is now out of public beta. Anyone got any ideas if this is fixed?

doesn't seem to work for me, I have gatsby site that works fine using the old google "UA" IDs

with google analytics 4 I can't seem to get my analytics integrated

For anyone arriving here from Google and facing challenges integrating a new Google Analytics account with a Measurement ID (starting "G-") instead of a tracking ID (starting "UA-"), it's still possible to create an old version Universal Analytics account when setting up your property in the Analytics dashboard. Under advanced settings use the option to create a Universal Analytics property as well as the default Google Analytics 4 property to ensure that you will also get a "UA-" tracking ID. This will let you use this plugin until it's updated for the new version of Google Analytics.

Are there any plans to upgrade to google analytics 4? If so, is there an issue to track the progress?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  路  3Comments

hobochild picture hobochild  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

ghost picture ghost  路  3Comments

magicly picture magicly  路  3Comments