Duplicate Google Analytics Events Triggered on Docusaurus Documentation Site #10568
Open
5 of 7 tasks
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
status: needs triage
This issue has not been triaged by maintainers
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
We are experiencing an issue where duplicate Google Analytics (GA) events are being sent when users visit our documentation site built using Docusaurus. This results in two page view counts for each user session in our GA reports.
Our main website is hosted at
www.test.com
and the documentation is available atwww.test.com/docs
. We have configured Google Analytics for the main website using a single gtag ID (G-test
). We also configured the Docusaurus documentation site using the same gtag ID via Docusaurus'@docusaurus/plugin-google-gtag
.Whenever we access the documentation site (
www.test.com/docs
), we observe twocollect
network calls being made to Google Analytics, which results in inflated user visit counts.Reproducible demo
No response
Steps to reproduce
my-docs-site
).@docusaurus/plugin-google-gtag
).collect
calls are made to Google Analytics for every user action.Expected behavior
collect
call should be made when visiting the documentation.Actual behavior
collect
calls are triggered for each page visit and navigation between pages on the documentation site, causing GA to log two user visits for every single page load or navigation event.Your environment
3.5.2
Self-service
The text was updated successfully, but these errors were encountered: