Skip to content

Commit

Permalink
docs: specify google-analytics and gtag plugins
Browse files Browse the repository at this point in the history
Closes #4678
  • Loading branch information
yiliansource committed Apr 29, 2021
1 parent 7ee116f commit 1986222
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion website/docs/api/plugins/plugin-google-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: '📦 plugin-google-analytics'
slug: '/api/plugins/@docusaurus/plugin-google-analytics'
---

The default [Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/) plugin. It is a JavaScript library for measuring how users interact with your website.
The default [Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/) plugin. It is a JavaScript library for measuring how users interact with your website **in the production build**. If you are using Google Analytics 4 you might need to consider using [plugin-google-gtag](./plugin-google-gtag) instead.

## Installation {#installation}

Expand Down
9 changes: 8 additions & 1 deletion website/docs/api/plugins/plugin-google-gtag.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ title: '📦 plugin-google-gtag'
slug: '/api/plugins/@docusaurus/plugin-google-gtag'
---

The default [Global Site Tag (gtag.js)](https://developers.google.com/analytics/devguides/collection/gtagjs/) plugin. It is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform. This section describes how to configure a Docusaurus site to enable global site tag for Google Analytics.
The default [Global Site Tag (gtag.js)](https://developers.google.com/analytics/devguides/collection/gtagjs/) plugin. It is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform, **in the production build**. This section describes how to configure a Docusaurus site to enable global site tag for Google Analytics.

:::tip

You can use [Google's Tag Assistant](https://tagassistant.google.com/) tool to check if your gtag is set up correctly!

:::

## Installation {#installation}

Expand All @@ -25,6 +31,7 @@ module.exports = {
plugins: ['@docusaurus/plugin-google-gtag'],
themeConfig: {
gtag: {
// You can also use your "G-" Measurement ID here.
trackingID: 'UA-141789564-1',
// Optional fields.
anonymizeIP: true, // Should IPs be anonymized?
Expand Down

0 comments on commit 1986222

Please sign in to comment.