-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
chore: add usercentrics for consent management #35384
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| ? 'https://frontend-assets.supabase.green' | ||
| : 'https://frontend-assets.supabase.com' | ||
|
|
||
| const USERCENTRICS_URLS = 'https://*.usercentrics.eu' |
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.
|
some tests: no VPN go www
docs VPN and no VPN same functionality as www
studio VPN does not show banner and can’t change privacy settings Fixes we need:
|
apps/studio/components/interfaces/Account/Preferences/AnalyticsSettings.tsx
Outdated
Show resolved
Hide resolved
|
Tested docs and www and studio
Should be last fixes needed:
|
|
ok the first pageview works now and tested the referrer shows t.co when i went from twitter to www homepage for in and out of EU. When in EU, I clicked to another page, clicked accept banner, then another page, and the new sent event still showed referrer as t.co I get 500 errors for UI lib preview. Code looks right though. If it looks good let's merge this ASAP so we can get some early data to roll in over the weekend when our traffic is low. |
jordienr
left a comment
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.
tested in docs and studio preview and looks good. Brave seems to block everything anyway but chrome sends the events after accepting the toast.
| // Although this is "technically" breaking the rules of hooks | ||
| // IS_PLATFORM never changes within a session, so this won't cause any issues | ||
| // eslint-disable-next-line react-hooks/rules-of-hooks | ||
| const { hasAcceptedConsent } = IS_PLATFORM ? useConsentToast() : { hasAcceptedConsent: true } |
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.
you could use an { enabled: bool } argument in the hook to enable/disable it conditionally without breaking the hook law
useConsentToast({ enabled: IS_PLATFORM })
Fixes bug where App Router pages (docs, www/blog) only tracked the initial page load but not subsequent navigations. The issue was introduced in PR #35384 which inverted the logic for the App Router telemetry tracking. The condition checked `!hasSentInitialPageTelemetryRef.current` which prevented tracking after the initial page view was sent. Changed to match Pages Router behavior: wait until initial page view is sent, then track all subsequent pathname changes. Before: Only first page view tracked After: All page navigations tracked (like Pages Router) Affects: docs app, www app (blog pages)
Fixes bug where App Router pages (docs, www/blog) only tracked the initial page load but not subsequent navigations. The issue was introduced in PR #35384 which inverted the logic for App Router telemetry tracking. The condition used a boolean flag that prevented tracking after the initial page view. The root cause: useEffect with [appPathname] dependency fires both on initial mount AND on pathname changes. The flag-based approach couldn't differentiate between these two cases. Solution: Track the previous pathname to detect actual changes. - Initial mount: previousAppPathnameRef is null, skip (initial effect handles it) - Navigation: previousAppPathnameRef !== appPathname, send telemetry Before: Only first page view tracked After: All page navigations tracked (like Pages Router) Affects: docs app, www app (blog pages)
Fixes bug where App Router pages (docs, www/blog) only tracked the initial page load but not subsequent navigations. The issue was introduced in PR #35384 which inverted the logic for App Router telemetry tracking. The condition used a boolean flag that prevented tracking after the initial page view. The root cause: useEffect with [appPathname] dependency fires both on initial mount AND on pathname changes. The flag-based approach couldn't differentiate between these two cases. Solution: Track the previous pathname to detect actual changes. - Initial mount: previousAppPathnameRef is null, skip (initial effect handles it) - Navigation: previousAppPathnameRef !== appPathname, send telemetry Before: Only first page view tracked After: All page navigations tracked (like Pages Router) Affects: docs app, www app (blog pages)
Addresses FE-1601, FE-1602 (indirectly) and FE-1603 (directly).
Testing
Non-EU:
EU:
Open docs/www/studio and ensure:
You can use a VPN to swap into Europe. Make sure to clear local storage in between changes.