Gatsby: Not updated for New Google Analytics

Created on 24 Oct 2020  路  4Comments  路  Source: gatsbyjs/gatsby

Hi - Google Analytics just characteristically rolled out a breaking change without notice. Now instead of tracking Id we have Measurement Id (because we need it so much). It seems this breaks the Gatsby plugin. Can we get an update where the new measurement id can either swap for the tracking id or have a new parameter for Measurement Id?

Thanks!

bug

Most helpful comment

Hi @btahir
I have been facing same problem due to upgrade of google analytics.
Found the solution for it.
If you have existing deprecated analytics you need to update it from property column in GA console page.(_I don't know exact process till end_).
If you are including to new project, check below steps.

  • Check out this docs page of plugin i.e google-tag which states this should be used instead of deprecated google analytics.
  • Add G measurement id from datastream page to plugin.
  • GATSBY_GTAG_DEBUG=true gatsby develop for checking analytics in localhost, no need for production.
  • You can check out GA is working or not after id by using this extension
  • This should reflect in analytics console page after couple of minutes.

All 4 comments

Hi @btahir
I have been facing same problem due to upgrade of google analytics.
Found the solution for it.
If you have existing deprecated analytics you need to update it from property column in GA console page.(_I don't know exact process till end_).
If you are including to new project, check below steps.

  • Check out this docs page of plugin i.e google-tag which states this should be used instead of deprecated google analytics.
  • Add G measurement id from datastream page to plugin.
  • GATSBY_GTAG_DEBUG=true gatsby develop for checking analytics in localhost, no need for production.
  • You can check out GA is working or not after id by using this extension
  • This should reflect in analytics console page after couple of minutes.

@rajatrao777 That worked! Thanks :)

Hi @rajatrao777 ,
i've seen your solution but don't understand it, can u help me a little?

what you mean add G measurement id to plugin?
There's no options to put G measurement id in gatsby-plugin-gtag document.
did you mean add a G measurement id on trackingId field?

oh i've solve the problem. nvm, thx!

Was this page helpful?
0 / 5 - 0 ratings