Add Usercentrics CMP (cookie consent + GDPR compliance)#3293
Add Usercentrics CMP (cookie consent + GDPR compliance)#3293
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
78002bf to
b35c52e
Compare
cd78aa3 to
0c8840a
Compare
0c8840a to
73440ad
Compare
73440ad to
dcd0505
Compare
d3dc1ff to
50f44ce
Compare
50f44ce to
9ad1416
Compare
|
|
||
| return { | ||
| 'script-src': [ | ||
| scriptOrigin, |
There was a problem hiding this comment.
Can we provide the complete link to the script instead of just its origin to make the rule stricter?
| { googleAnalyticsFeature.isEnabled && ( | ||
| <> | ||
| <script | ||
| { ...(usercentricsFeature.isEnabled ? { type: 'text/plain', 'data-usercentrics': 'Google Analytics' } : {}) } | ||
| async | ||
| src={ `https://www.googletagmanager.com/gtag/js?id=${ googleAnalyticsFeature.propertyId }` } | ||
| /> | ||
| { } | ||
| <script | ||
| { ...(usercentricsFeature.isEnabled ? { type: 'text/plain', 'data-usercentrics': 'Google Analytics' } : {}) } | ||
| dangerouslySetInnerHTML={{ __html: GA_INLINE_SCRIPT }} | ||
| /> | ||
| </> | ||
| ) } |
There was a problem hiding this comment.
Why is it necessary to include the Google Analytics script in the head tag instead of loading it after the page loads? I assume there will be two scripts loaded: one from here and another from the ui/shared/GoogleAnalytics.tsx component.
Description and Related Issue(s)
resolves #3289
Proposed Changes
added NEXT_PUBLIC_USERCENTRICS_CONFIG variable to set usercentrics script src and ruleset id.
Additional Information
Usercentrics has manual and auto modes. Here we support manual mode (client who requested feature uses manual mode).
Usercentrics requires to set the exact website domain (or list of the domains) on their side, otherwise won't work. Also, at least one Data Processing Services should be added to ruleset. If empty, usercentrics treat any user selection as 'ALL_ACCEPTED'.
Also, there are 3 categories: essential, functional and marketing. In this PR, only marketing acceptance is supported (including 'accept all' case).
Checklist for PR author