New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Plugin docusaurus-plugin-google-analytics is used 2 times with id=default. #3632
Comments
Hi, If you use the classic preset with So you actually have 2 instances of the google analytics plugin running on your site, which is likely not something you want right? I'll improve the error message to make this clearer |
Ah, I didn't know it was added by default now. Thanks! |
it is added only when your preset classic has the googleAnalytics config attribute |
Hello @slorber, Sorry to comment on this closed issue, but I wonder where to put exactly the I've tried: presets: [
[
'@docusaurus/preset-classic',
{
themeConfig: {
googleAnalytics: {
trackingID: 'XXX',
// Optional fields.
anonymizeIP: true, // Should IPs be anonymized?
},
},
},
],
], And: presets: [
[
'@docusaurus/preset-classic',
{
googleAnalytics: {
trackingID: 'XXX',
// Optional fields.
anonymizeIP: true, // Should IPs be anonymized?
},
},
],
], And: module.exports = {
themeConfig: {
googleAnalytics: {
trackingID: 'XXX',
// Optional fields.
anonymizeIP: true, // Should IPs be anonymized?
},
},
} But no success so far 馃槃 Version: Thank you for your help! |
https://v2.docusaurus.io/docs/api/plugins/@docusaurus/plugin-google-analytics/#configuration this one should work:
Note: it is only enabled on the production build, so you'll have to use docusaurus build && docusaurus serve to test that |
Thanks @slorber for the quick answer. 馃槈 The "working" solution was the one I tried first but alas it did not and still do not work. I'm using a GitHub workflow to deploy my documentation on the yarn install --frozen-lockfile
yarn deploy So either:
Thanks for your time! 馃槃 |
@gulien I will only be able to help you if you provide me a repro using the config I gave you + a live deployment where I can indeed see it does not work. |
My bad the documentation source code is located here: And the documentation is available here: https://thecodingmachine.github.io/symfony-boilerplate/ |
Ok so GA do not show anything, so I guess I actually did not configura GA correctly on my side... |
that's probably it yes :) afaik it works on RN website |
I am using @docusaurus/preset-classic, in my case, it is not collecting data. I tried to google analytics as well as gtag method but neither one is working. |
@adsazad there were changes recently on this (config was moved from themeConfig to plugin options), and we can't help if you don't provide your docusaurus version and provide more context If you follow the official doc of your exact docusaurus version (not production doc), you should be able to make it work and see GA requests in the network tab Also note that Google launched Google Analytics 4, to progressively replace all the former analytics generations, and we don't support that yet. There's an issue to support it here: #7221 |
馃悰 Bug Report
I upgraded to the latest version and got this
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
Install google analytics plugin on a docusaurus instance (it might happen with other plugins but we only use the GA one)
Try it here https://github.com/openmultiplayer/wiki/ using commit
2b2321341d32121ff3195fc801d0831b1693ce10
I fixed it by giving the GA plugin an explicit ID: openmultiplayer/wiki@6fada68
Your Environment
The text was updated successfully, but these errors were encountered: