gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.28k stars 10.31k forks source link

Update analytics doc to include google-plugin-gtag #27065

Closed meganesu closed 4 years ago

meganesu commented 4 years ago

Summary

The existing docs about adding Google analytics recommend using the gatsby-plugin-google-analytics. Under the hood, this plugin uses Google's analytics.js file.

However, Google has a guide recommending users upgrade to gtag.js instead. There is another plugin (gatsby-plugin-gtag) which uses gtag.js.

Motivation

The gtag.js file works with all Google services. Here are a few resources with more information about the difference between gtag.js and analytics.js:

Steps to resolve this issue

Open a pull request

meganesu commented 4 years ago

There's still an open question around what to do with the existing section for how to use gatsby-plugin-google-analytics.

98lenvi commented 4 years ago

Hi @meganesu, I can help with this! Can you assign the issue to me?

I'm going to proceed with option 1,

wardpeet commented 4 years ago

@meganesu I would try to promote gtag as much as we can (option 2). If you follow Google's developer docs and/or copy-paste from analytics itself you get a gtag code and not an analytics code anymore.

I don't think our docs need to be talking about the difference between gtag or analytics. It would only confuse people. We don't want to give users to many options :joy:, users who are invested in analytics probably already know the difference or google about it. We could add a note to the readme files of the plugins so it's documented somewhere.

meganesu commented 4 years ago

@wardpeet sounds good, thanks for the recommendation!

@98lenvi thanks for tackling this issue. Could you please update your PR to match @wardpeet's recommendation? Feel free to reach out if you have any questions about the changes.

98lenvi commented 4 years ago

@meganesu, Hi! can you check the PR now? I have made the changes.

akgupta0777 commented 4 years ago

Is this necessary that the issue assigned to somebody only He/She can do? I am new to Github and Open Source Development.

@LekoArts

LekoArts commented 4 years ago

@akgupta0777 When an issue can only be fixed by one PR (which is the case here) it's common etiquette that a person offers their help and then picks up the work. This should be communicated clearly in the issue so that other people who want to help see that it's already being addressed and not duplicate PRs are opened. To make things clearer we ("Gatsby") assign issues to people then.

In the case of an issue being solvable by multiple PRs (e.g. "solve issue X around the docs") the persons should all comment that they want to change things X,Y,Z so that - again - people are not doing duplicate work.

You can still help out by leaving review comments on the PR (although most of the time the core maintainers do that).

If the person who initially signed up for sending in a PR didn't do that after quite some time (OSS is most of the times in the free time of people so don't expect anyone to instantly create things) you could ask in the issue if you instead could pick it up (or any other person).

akgupta0777 commented 4 years ago

Thanks I understood now.

muescha commented 3 years ago

i think we should also update the readme in gatsby-plugin-google-analytics

akgupta0777 commented 3 years ago

Can I do this thing updating in readme task ?

muescha commented 3 years ago

@akgupta0777 sorry i did read your help to late :(

i have done a PR

akgupta0777 commented 3 years ago

@muescha It's ok, not a problem.