feat: integrate Microsoft Clarity for mobile session recording and heatmaps
This commit is contained in:
14
lib/core/analytics/clarity_analytics.dart
Normal file
14
lib/core/analytics/clarity_analytics.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'package:clarity_flutter/clarity_flutter.dart';
|
||||
|
||||
/// Microsoft Clarity configuration — separate mobile project so recordings
|
||||
/// and heatmaps are isolated from web traffic.
|
||||
class ClarityAnalytics {
|
||||
ClarityAnalytics._();
|
||||
|
||||
static const _projectId = 'wgtcstm336';
|
||||
|
||||
static final ClarityConfig config = ClarityConfig(
|
||||
projectId: _projectId,
|
||||
logLevel: LogLevel.None,
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:clarity_flutter/clarity_flutter.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:real_estate_mobile/config/app_config.dart';
|
||||
import 'package:real_estate_mobile/config/firebase_config.dart';
|
||||
import 'package:real_estate_mobile/core/analytics/clarity_analytics.dart';
|
||||
import 'package:real_estate_mobile/core/theme/app_theme.dart';
|
||||
import 'package:real_estate_mobile/core/utils/image_url_resolver.dart';
|
||||
import 'package:real_estate_mobile/routing/app_router.dart';
|
||||
@@ -20,7 +22,12 @@ Future<void> mainCommon(Flavor flavor) async {
|
||||
// forces every image to re-download, causing visible delay on all screens.
|
||||
ImageUrlResolver.instance.clearCache();
|
||||
|
||||
runApp(const ProviderScope(child: MyApp()));
|
||||
runApp(
|
||||
ClarityWidget(
|
||||
clarityConfig: ClarityAnalytics.config,
|
||||
app: const ProviderScope(child: MyApp()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends ConsumerWidget {
|
||||
|
||||
Reference in New Issue
Block a user