Replace PostHog integration with AnalyticsManager architecture

Remove old PostHogAnalytics singleton and replace with guide-based
two-file architecture: AnalyticsManager (singleton wrapper with super
properties, session replay, opt-out, subscription funnel) and
AnalyticsEvent (type-safe enum with associated values).

Key changes:
- New API key, self-hosted analytics endpoint
- All 19 events ported to type-safe AnalyticsEvent enum
- Screen tracking via AnalyticsManager.Screen enum + SwiftUI modifier
- Remove all identify() calls — fully anonymous analytics
- Add lifecycle hooks: flush on background, update super properties on foreground
- Add privacy opt-out toggle in Settings
- Subscription funnel methods ready for IAP integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-11 09:48:49 -06:00
parent 09be5fa444
commit 2fc4a48fc9
50 changed files with 2191 additions and 335 deletions
+12
View File
@@ -17342,6 +17342,9 @@
"Generate New Code" : {
"comment" : "A button label that appears when a user wants to generate a new invitation code.",
"isCommentAutoGenerated" : true
},
"Help improve Casera by sharing anonymous usage data" : {
},
"Hour" : {
"comment" : "A picker for selecting an hour.",
@@ -17442,6 +17445,9 @@
"No active code" : {
"comment" : "A message indicating that a user does not have an active share code.",
"isCommentAutoGenerated" : true
},
"No personal data is collected. Analytics are fully anonymous." : {
},
"No properties yet" : {
@@ -17502,6 +17508,9 @@
"Primary" : {
"comment" : "A label indicating that a residence is the user's primary residence.",
"isCommentAutoGenerated" : true
},
"Privacy" : {
},
"Pro" : {
"comment" : "The title of the \"Pro\" plan in the feature comparison view.",
@@ -24897,6 +24906,9 @@
}
}
}
},
"Share Analytics" : {
},
"Share Code" : {
"comment" : "A label displayed above the share code section of the view.",