feat: PostHog analytics wiring across all key screens
- Commit untracked posthog_service.dart (fire-and-forget HTTP client,
EU data residency, already used by auth for identify/reset)
- screen() calls: Home, Contribute, Profile, EventDetail (with event_id)
- capture('event_tapped') on hero carousel card tap (source: hero_carousel)
- capture('book_now_tapped') in _navigateToCheckout (event_id + name)
- capture('review_submitted') in _handleSubmit (event_id + rating)
- Covers all 4 expansion items from security audit finding 8.2
This commit is contained in:
@@ -6,6 +6,7 @@ import '../../../widgets/bouncing_loader.dart';
|
||||
import '../../../core/utils/error_utils.dart';
|
||||
import '../models/review_models.dart';
|
||||
import '../services/review_service.dart';
|
||||
import '../../../core/analytics/posthog_service.dart';
|
||||
import 'review_summary.dart';
|
||||
import 'review_form.dart';
|
||||
import 'review_card.dart';
|
||||
@@ -82,6 +83,10 @@ class _ReviewSectionState extends State<ReviewSection> {
|
||||
|
||||
Future<void> _handleSubmit(int rating, String? comment) async {
|
||||
await _service.submitReview(widget.eventId, rating, comment);
|
||||
PostHogService.instance.capture('review_submitted', properties: {
|
||||
'event_id': widget.eventId,
|
||||
'rating': rating,
|
||||
});
|
||||
await _loadReviews(); // Refresh to get updated stats + review list
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user