Skip to main content

Google Analytics

Google Tag Manager and GTag are Docusaurus plugins available for Google Analytics.

info

The Google Tag Manager and GTAag plugin is pre-installed by default with this template repo.

tip

Please join the #documentation Slack channel and request for your tags. Make sure to provide some information about your project in your request.

Setting up GTag and GTM in docusaurus.config.js​

Fill in with the provided values in the highlighted lines shown below in the docusaurus.config.js.

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