mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 17:37:09 +02:00
docs(v2): specify google-analytics and gtag plugins (#4703)
Closes #4678
This commit is contained in:
parent
86cab6111b
commit
5fc5071882
2 changed files with 9 additions and 2 deletions
|
@ -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}
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue