-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Add Google Global Site Tag Plugin #8341
Comments
Seems like a great plan! Would love an official plugin added here for it. |
@tylerbuchea would you like to create this plugin for Gatsby? |
It'd be an honor 🙂 |
I wrote a quick version of this here, in case it helps:
Happy to publish a plugin, too, though it'll be a week or two before I get around to it. |
Yeah kmjennison that is essentially it. There are some other pieces revolving around gtag options, multiple trackingIds, DNT, and pageview events. I'm done building the plugin and in the testing phase with my brother now. Would love some help though if you're interested? |
@tylerbuchea Sure, happy to help, though mostly offline this week. LMK how I can be helpful. |
@tylerbuchea any updates here? |
Been busy moving but my goal is to open the PR before this weekend. |
This PR adds support for Google's Global Site Tag (gtag) and closes #8341 you can view that issue for a detailed breakdown.
Prerequisite
The way I understand it is that Google now has 3 properties for tracking visitors on a website. These 3 are similarly named and sort of do the same thing so I want to define them up front so no one gets confused.
Google Analytics/GA/analytics.js - This is the legacy code snippet that is used to send data to Google Universal Analytics
Global Site Tag/GST/gtag.js - This is the new code snippet that is also used to send data to Google Universal Analytics. It is an improved library taking into consideration modern standards and it has the added benefit of integrating with other Google Services such as Adwords.
Google Tag Manager or GTM - This is different from the other two in that once it is enabled on a site the events can be updated via the GTM dashboard and doesn't require a developer. This is a cool technology but isn't what I'll be talking about today.
There are already Gatsby plugins for 1 and 3 but not for 2.
https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics
https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-tagmanager
Proposal
Given the fact that more of Google's services are converging on the
gtag.js
snippet I think it makes sense to add an official Gatsby pluginpackages/gatsby-plugin-google-gtag
.Is this something the community has already been thinking about or something we'd be interested in adding?
Resources
The text was updated successfully, but these errors were encountered: