-
Notifications
You must be signed in to change notification settings - Fork 8
Implement Cookie Consent Management for Microsoft Clarity GDPR Compliance #770
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
Implement Cookie Consent Management for Microsoft Clarity GDPR Compliance #770
Conversation
…ty and Google Analytics Co-authored-by: BenjaminMichaelis <[email protected]>
c386792 to
0e3fabf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a comprehensive cookie consent management system to comply with Microsoft Clarity's new GDPR enforcement requirements for users in the European Economic Area (EEA), United Kingdom, and Switzerland, effective October 31, 2025.
Key changes include:
- Addition of a complete consent management system using Google Consent Mode v2
- Integration with existing analytics scripts (Microsoft Clarity and Google Analytics)
- Enhanced privacy policy with consent management interface
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| wwwroot/js/consent-manager.js | New comprehensive consent management system with region detection, cookie handling, and UI components |
| Views/Shared/_Layout.cshtml | Integration of consent manager with existing analytics scripts and footer link for preferences |
| Views/Home/Privacy.cshtml | Enhanced privacy policy content with detailed cookie information and consent management controls |
45fef04 to
d3852ef
Compare
Implements comprehensive cookie consent management to comply with Microsoft Clarity's new consent enforcement requirements for users in the European Economic Area (EEA), United Kingdom, and Switzerland, effective October 31, 2025.
Problem
Microsoft Clarity will begin enforcing explicit consent signals for users from EEA/UK/Switzerland regions. Without proper consent implementation, Essential C# would lose analytics functionality and user behavior insights for visitors from these regions, impacting the ability to improve the learning experience.
Solution
This implementation provides a production-ready consent management system using Google Consent Mode v2 that works seamlessly with both Microsoft Clarity and Google Analytics:
Key Features
🌍 Smart Region Detection
?testConsent=trueURL parameter🎛️ Granular Consent Control
🔧 Technical Integration
clarity('consent', boolean))📱 Enhanced User Experience
Technical Implementation
The consent manager integrates with existing analytics scripts by:
Screenshots
Consent Banner Display:

Testing Interface:

Files Added/Modified
wwwroot/js/consent-manager.js- Complete consent management systemViews/Shared/_Layout.cshtml- Integrated consent manager with analytics scriptsViews/Home/Privacy.cshtml- Enhanced privacy policy with consent managementCOOKIE_CONSENT.md- Implementation documentation and maintenance guideCompliance
This implementation ensures full compliance with:
The solution is backward-compatible and doesn't affect existing functionality for users outside affected regions. Essential C# will continue providing excellent learning experiences while respecting user privacy preferences.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.