diff --git a/packages/gatsby-plugin-google-analytics/README.md b/packages/gatsby-plugin-google-analytics/README.md index fb2f832e66ed6..6c2d36ea8ea45 100644 --- a/packages/gatsby-plugin-google-analytics/README.md +++ b/packages/gatsby-plugin-google-analytics/README.md @@ -2,6 +2,10 @@ Easily add Google Analytics to your Gatsby site. +## Upgrade note + +This plugin uses Google's `analytics.js` file under the hood. Google has a [guide recommending users upgrade to `gtag.js` instead](https://developers.google.com/analytics/devguides/collection/upgrade/analyticsjs). There is another plugin [`gatsby-plugin-gtag`](https://gatsbyjs.com/plugins/gatsby-plugin-google-gtag/) which uses `gtag.js`. + ## Install `npm install gatsby-plugin-google-analytics` @@ -60,13 +64,15 @@ To use it, simply import it and use it like you would the `` element e.g. import React from "react" import { OutboundLink } from "gatsby-plugin-google-analytics" -export default () => ( +const Component = () => (
- + Visit the Google Analytics plugin page!
) + +export default Component ``` ## Options @@ -164,10 +170,10 @@ To allow custom events to be tracked, the plugin exposes a function to include i To use it, import the package and call the event within your components and business logic. ```jsx -import React -import { trackCustomEvent } from 'gatsby-plugin-google-analytics' +import React from "react" +import { trackCustomEvent } from "gatsby-plugin-google-analytics" -export default () => { +const Component = () => (
-} +) + +export default Component ``` ### All Fields Options