Fix Microsoft Clarity consent API property names for GDPR compliance #786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes critical Microsoft Clarity consent implementation to ensure compliance with GDPR requirements ahead of the October 31, 2025 enforcement deadline.
Problem
The Microsoft Clarity consent API call was using incorrect property names, preventing proper consent signal transmission:
This meant that user consent preferences were not being properly communicated to Microsoft Clarity, potentially causing compliance issues for users in EEA, UK, and Switzerland regions.
Solution
Updated the consent API call to use the correct property names as specified in Microsoft's documentation:
Testing
Added comprehensive testing tools including Microsoft's recommended verification function:
The implementation now correctly shows:
{analytics_storage: "DENIED", ad_storage: "DENIED"}{analytics_storage: "GRANTED", ad_storage: "GRANTED"}Screenshot
The test page demonstrates successful consent state management with proper API integration.
Impact
This minimal but critical fix ensures that essentialcsharp.com maintains proper user privacy controls while enabling full Microsoft Clarity functionality when consent is granted.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.