Skip to main content

Configure Google Analytics

Docusaurus supports Google Tag Manager and GTag plugins for Google Analytics. The plugins are installed by default in this template repository.

Set up Google Tag Manager and GTag

Join the #documentation channel on Consensys Slack and request your Google Analytics tags. Provide information about your project in your request.

After receiving your tags, fill those values in docusaurus.config.js in the highlighted lines as follows:

docusaurus.config.js
const config = {
plugins: [
[
"@docusaurus/plugin-google-gtag",
{
trackingID: "G-",
anonymizeIP: true,
},
],
[
"@docusaurus/plugin-google-tag-manager",
{
containerId: "GTM-",
},
],
],
};