-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make gtag compliant with GDPR #2407
Comments
Please read the docs - https://v2.docusaurus.io/docs/migrating-from-v1-to-v2/#gatrackingid |
@yangshun thanks for the quick hint, how come the documentation doesnt show GTM-ABCDE , Google Tag Manager Identifications start with GTM and Universal Analytics from Google with UA |
@yangshun Actually you should reopen the Issue. Docusaurus can't load GTAG Manager and is therefore uncompliant by default for European data regulations and privacy rights of the customer. This makes docusaurus un-useable for european companies. The modern GTAG (not to mistake by "GATAG or UA" which are the old versions), can understand if the customer wants his data to be taken or not for visiting the page. Otherwise docusaurus would need to implement an opt out banner itself to not load the Analytics. |
Ok then it's an improvement to make, and not a bug in the current implementation. |
@yangshun Thanks, i've corrected the header accordingly |
This would be a nice feature but just wanted to point out that google tag manager integration never existed in v1. |
@shinebayar-g - I'm using V1 in several of my documentation website and have integrated with Google Tag Manager. The way I've done it is this:
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','<GTM-TAG-ID-GOES-HERE>');
scripts: [
siteUrl + "js/ep-google-tag-manager.js",
'https://buttons.github.io/buttons.js'
] The above steps will add the integration for you. This would be a very simple feature for the V1 so that we could just add tag manager in ...
gtm_id: <GTM-TAG-ID-GOES-HERE>
... But the V1 code base is apparently locked now; no small features or even bug fixes, even though V2 is not even past the alpha release yet. |
No it isnt, the naming made me think it was but it was the prior version
Would have been nice if you wrote it into the new codebase, the current Docusaurus cant be used without the consent notices for spying which documentation pages are visited. Makes it very unuseable, we like Docusaurus very much but compliance comes first |
Not sure what you mean @Alcatros . It was just a workaround showing how gtm can be used with V1 as of this moment. |
I believe we have happy users of GTM, like the React-Native website. This issue is a bit messy and I have no idea what action to take on it. If there's still an issue on GTM support please open a new proper issue @Alcatros |
Ran into this problem, so just wanted to explain why I think it's still an issue. https://reactnative.dev/ is using a universal analytics tag The solution would be to allow the docusaurus plugin-google-gtag to accept both tags like Currently, if you shove a Hope this is helpful in explaining the issue as I've experienced it. |
Please explain how to do so. I'm not an expert at all on these topics and don't really understand why our current implementation is limited and can't work with Also, what prevents you from implementing your own Docusaurus plugin in userland? The goal of Docusaurus is not to provide an exhaustive list of fully-featured Analytics plugins. If gtag/ga plugins are in Docusaurus core, that's only because we use those plugins on the Docusaurus site itself, and should not be interpreted as a commitment for us to provide the ideal analytics for your use-case. Considering I'm not an expert on this subject, it would be simpler for me if someone solved this first in userland so that I understand what it takes to support GTM tags, and then we could eventually find a way to merge this in Docusaurus core later if it makes sense. |
@slorber very fair. My comment was only intended to clarify the ambiguities around the issue for anyone stumbling across the thread as I did. Whether its worth fixing is definitely up to you and the team or anyone who has time. I didn't request a fix, just provided some information in case it was useful. I think the simplest work around is the one suggested earlier by @Alcatros. All the best. |
Thanks, going to re-open then. I understand that Docusaurus is not compliant with GDPR. We are discussing internally to provide infrastructure to allow plugin authors (including ourselves) to hook into a global consent/cookie banner, so we'll make the GA/GTAG plugins compliant. However, what I don't understand is why the lack of compliance with GDPR would actually make the plugin unusable with GTM? I understand that you can't use it for legal reasons (only if you are in the EU BTW), not WHY it doesn't work. @Alcatros can you clarify please?
How does the "modern GTAG" know exactly? |
@slorber since my initial comments a lot of things have changed. Here the reference for GTAG: |
I don't believe GDPR compliance is solveable by Docusaurus (unless they bend over backwards to come up with some kind of free consent logging solution and make it easy to block cookie logic based on consent cookie), but it is easily solveable by the JAM stack architecture of using a Javascript based cookie consent API. So it might be worth closing this issue / declaring it as something the devs shouldn't try to solve, and instead directing people to use a solution like 1 of the 3 mentioned below, and if you google there's plenty more that exist than these. I just finished implementing what I think is a compliant solution for my website: When I was researching I read that the laws have evolved to a point where "consent logging" of cookie consent is recommended for maximum compliance. I'm unsure if it's actually required or just strongly encouraged. Here are multiple sources that all recommend implementing consent logging: (Note no need to read through the following 3 links, I've summarized some key details further down, just trying to show sources of where I came up with the summarized information.)
Consent logging = needs a database = costs money The strictest compliance to internet privacy laws seem to require
Here's relevant config snippet from my
I login to termsfeed and add Google Analytics and Google Adsense to their solution. Their script makes it so Google AdSense and Google Analytics don't run until after the user has consented. And prevent them from running if the user removes their consent. Also in the footer I was able to create a button to let users adjust their consent at any time. The button id's in the footer correspond to the termsfeed script / login portal website's docs. guidescape.com if you want to see how the solution looks. Note: I haven't used cookieyes.com but they have a reasonable / usable free tier that seems to meet GDPR requirements. Another advantage of this approach is that it's a generic solution that works for all cookie use cases not just gtag. Here are some snippets of the termsfeed.com login portal if anyone's curious: Additional Notes:
|
🐛 Improvement (European E-Privacy directive and GDPR) - GTAG Manager not recognized
We add the google tag manager configuration like described in Docusaurus 1 but Docusaurus 2 seems not to recognize it. Responds with : Error: The field(s) 'gaTrackingId', 'gaGtag' are not recognized in docusaurus.config.js
I've realised that GTAG Manager can't be loaded with the current implementation, this is not according to the european data regulations eg. GDPR and E-Privacy. Therefore the errors below are not correct as stated as the feature is missing and we have changed it from a bug report to an improvement.
To Reproduce
Use the following config:
Reproduction Steps:
yarn run v1.19.2
$ docusaurus build
Creating an optimized production build...
Error: The field(s) 'gaTrackingId', 'gaGtag' are not recognized in docusaurus.config.js
Expected behavior
I would have expected this to incorporate Google Tag Manager properly
Actual Behavior
It responded with the error message Error: The field(s) 'gaTrackingId', 'gaGtag' are not recognized in docusaurus.config.js
Your Environment
Reproducible Demo
I dont have a runnable demo, as my build server is in a vpc, but i assume that you would be able to tell me if im doing something which is not possible or if its a bug / if im the first one to try, thank you
The text was updated successfully, but these errors were encountered: