Stirling-PDF/frontend/public
ConnorYoh 960d48f80c
Customised Analytics for admins and users (#4687)
Adds granular privacy controls for analytics - splits single
enableAnalytics toggle into separate PostHog and Scarf controls with
improved admin
  UX.

  Backend Changes

  Configuration (ApplicationProperties.java)
  - Added enablePosthog and enableScarf boolean fields
- New methods: isPosthogEnabled(), isScarfEnabled() (null = enabled when
analytics is on)

  Services
- PostHogService: Now checks isPosthogEnabled() instead of
isAnalyticsEnabled()
  - ConfigController: Exposes new flags via API
- SettingsController: Changed endpoint from @RequestBody to
@RequestParam

  Frontend Changes

  Architecture
- Converted useAppConfig hook → AppConfigContext provider for global
access
  - Added refetch() method for config updates without reload

  New Features
1. AdminAnalyticsChoiceModal: First-launch modal when enableAnalytics
=== null
    - Enable/disable without editing YAML
    - Includes documentation link
  2. Scarf Tracking System: Modular utility with React hook wrapper
    - Respects config + per-service cookie consent
    - Works from any code location (React or vanilla JS)
3. Enhanced Cookie Consent: Per-service toggles (PostHog and Scarf
separate)

  Integration
  - App.tsx: Added AppConfigProvider + scarf initializer
  - HomePage.tsx: Shows admin modal when needed
  - index.tsx: PostHog opt-out by default, service-level consent

  Key Benefits

 Backward compatible (null defaults to enabled)
 Granular control per analytics service
 First-launch admin modal (no YAML editing)
 Privacy-focused with opt-out defaults
 API-based config updates

---------

Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
2025-10-27 16:54:59 +00:00
..
branding V2 styling requests (#4288) 2025-08-26 16:31:20 +01:00
css Basic footer structure and Cookie Consent (#4320) 2025-08-29 13:01:46 +00:00
js/thirdParty Basic footer structure and Cookie Consent (#4320) 2025-08-29 13:01:46 +00:00
locales Customised Analytics for admins and users (#4687) 2025-10-27 16:54:59 +00:00
Login V2: Login Feature (#4701) 2025-10-24 10:49:52 +01:00
og_images Seo v2 add home (#4211) 2025-08-14 16:36:24 +01:00
samples Add onboarding flow using Reactour (#4635) 2025-10-20 15:07:40 +01:00
favicon.ico change logos, favicon and browser tab title (#4032) 2025-07-25 12:14:37 +01:00
logo192.png change logos, favicon and browser tab title (#4032) 2025-07-25 12:14:37 +01:00
logo512.png change logos, favicon and browser tab title (#4032) 2025-07-25 12:14:37 +01:00
logo-tooltip.svg Feature/v2/tooltips (#4112) 2025-08-08 12:09:41 +01:00
manifest.json Update manifest.json (#4203) 2025-08-13 18:29:25 +01:00
robots.txt Initial react set up 2025-05-09 20:01:09 +01:00