Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update adding-analytics.md #27624

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Update adding-analytics.md #27624

merged 1 commit into from
Nov 3, 2020

Conversation

im-adithya
Copy link
Contributor

Description

Gatsby uses gatsby-plugin-google-gtag instead of gatsby-plugin-gtag. Hence the doc needed to be updated.
This PR closes #27623

@im-adithya im-adithya requested a review from a team as a code owner October 23, 2020 18:44
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 23, 2020
@pfortes
Copy link

pfortes commented Oct 23, 2020

That was fast! Thanks @im-adithya,
I think this little change can be super good for new users looking at how to use gtag correctly with gatsby.

@meganesu meganesu added type: documentation An issue or pull request for improving or updating Gatsby's documentation and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Oct 23, 2020
@LekoArts LekoArts mentioned this pull request Oct 30, 2020
@im-adithya
Copy link
Contributor Author

@LekoArts @meganesu Can you please merge this as Hacktoberfest is going to end 🥺

@meganesu
Copy link
Contributor

meganesu commented Nov 1, 2020

@im-adithya I haven't gotten a chance to review this in detail yet, but I added the hacktoberfest-accepted label in the meantime so that you should be able to get credit.

@Miyou
Copy link

Miyou commented Nov 2, 2020

What about the plugin gatsby-plugin-google-analytics? What's the difference? Can't find any info about which one to use which is very confusing.

@pfortes
Copy link

pfortes commented Nov 2, 2020

What about the plugin gatsby-plugin-google-analytics? What's the difference? Can't find any info about which one to use which is very confusing.

I will try to explain,
gatsby-plugin-google-analytics uses analytics.js which is the old code from google and is an oficial gatsby plugin.
gatsby-plugin-google-gtag uses the gtag script (new one and the one you should use) this is also an oficial plugin.

gatsby-plugin-gtag is not a oficial plugin.

Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you 💜

@pvdz pvdz merged commit 216d1d8 into gatsbyjs:master Nov 3, 2020
@Miyou
Copy link

Miyou commented Nov 9, 2020

What about the plugin gatsby-plugin-google-analytics? What's the difference? Can't find any info about which one to use which is very confusing.

I will try to explain,
gatsby-plugin-google-analytics uses analytics.js which is the old code from google and is an oficial gatsby plugin.
gatsby-plugin-google-gtag uses the gtag script (new one and the one you should use) this is also an oficial plugin.

gatsby-plugin-gtag is not a oficial plugin.

Thanks! That makes a lot of sense. Maybe it is obvious for those who know that there are two different google analytics scripts, but for someone who didn't I really couldn't figure out the difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update analytics doc to use official Gatsby gtag plugin
5 participants