skip to Main Content

Is there any API to show firebase analytics in the flutter app?

2

Answers


  1. Firebase Analytics Integration

    Create a new class with the name FirebaseAnalyticsService

    import ‘package:firebase_analytics/firebase_analytics.dart’;
    
    import ‘package:firebase_analytics/observer.dart’;
    
    class FirebaseAnalyticsService {
    
    final FirebaseAnalytics _analytics = FirebaseAnalytics();
    
    FirebaseAnalyticsObserver appAnalyticsObserver() =>
    
    FirebaseAnalyticsObserver(analytics: _analytics);}
    

    Now register this class in our servicelocator file:

    serviceLocator.registerLazySingleton(() => FirebaseAnalyticsService());
    

    reference: https://medium.datadriveninvestor.com/how-to-add-firebase-analytics-to-your-flutter-app-641fbda1d224

    Login or Signup to reply.
  2. You may consider Google Analytics Data API which gives you programmatic access to Google Analytics 4 (GA4) report data. Note that data isn’t in realtime and reporting also undergoes delays in processing as described in this blog post.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search