Flutterfire: firebase_analytics 5.0.15 Events not showing on firebase console dashboard.

Created on 15 Jun 2020  Β·  16Comments  Β·  Source: FirebaseExtended/flutterfire

Firebase analytics not showing any events even after 48 hours on in firebase dashboard.

Future<void> mainDelegate() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AnalyticsHelper.configure();
  runApp(MyApp());
}
 child: MaterialApp(
        onGenerateRoute: NavigationUtils.generateRoute,
        navigatorObservers: [AnalyticsHelper.analyticsObserver],
      )
import 'dart:async';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:flutter/material.dart';
import 'package:firebase_analytics/observer.dart';
import '../common/shared_preferences_keys.dart';

class AnalyticsHelper {
  static final AnalyticsHelper _singleton = AnalyticsHelper._internal();

  static String tag = 'ANALYTICS_HELPER';

  /*EventName*/
  static String eventNormalLogin = "normal_login";
  static String eventFBLogin = "fb_login";
  static String eventGoogleLogin = "google_login";
  static String eventAppleLogin = "apple_login";
  static String eventNormalRegister = "normal_register";
  static String eventFBRegister = "fb_register";
  static String eventGoogleRegister = "google_register";
  static String eventAppleRegister = "apple_register";
  static String eventGroup = "group";
  static String eventPurveyorDetails = "purveyor_details";
  static String eventPackageSubscribe = "package_subscribe";
  static String eventUnlimitedSubscribe = "unlimited_subscribe";
  static String eventUpgradeSubscribe = "upgrade_package_subscribe";
  static String eventAddNewMemberSubscribe = "add_new_member_subscribed";
  static String eventCheckIn = "check_in";
  static String eventShareCheckIn = "share_check_in";
  static String eventAddCartTickets = "add_to_cart_ticket";
  static String eventAddCartDeal = "add_to_cart_deal";
  static String eventAddCartGift = "add_to_cart_gift";
  static String eventRedeemGift = "redeem_gift";
  static String eventPaymentByACH = "payment_by_ach";
  static String eventPaymentByCARD = "payment_by_card";

  static Future<void> configure() async {
    analytics = FirebaseAnalytics();
    analyticsObserver = FirebaseAnalyticsObserver(analytics: analytics);
  }

  factory AnalyticsHelper() {
    return _singleton;
  }

  AnalyticsHelper._internal();

  static FirebaseAnalytics analytics;
  static NavigatorObserver analyticsObserver;

  static Future<void> sendEvent(
      String name, Map<String, dynamic> params) async {
    debugPrint("EventName : $name");
    await analytics.logEvent(
      name: name,
      parameters: params,
    ).then((value) => (){
      debugPrint("EventName success ");
    }).catchError((onError) {
      debugPrint("EventName catchError ${onError} ");

    });
  }

  static Future<void> setFireBaseEventPurveyorBusinessID(
      String eventName, String id) async {
    await sendEvent(
      eventName,
      {
        'email': getUserEmail(),
        'userID': getUserID(),
        'businessID': id,
      },
    );
  }

  static Future<void> setFireBaseEventPurveyor(
      String eventName, String id) async {
    await sendEvent(
      eventName,
      {
        'email': getUserEmail(),
        'userID': getUserID(),
        'purveyorID': id,
      },
    );
  }

  static Future<void> setFireBaseEventPackageID(
      String eventName, String id) async {
    await sendEvent(
      eventName,
      {
        'email': getUserEmail(),
        'userID': getUserID(),
        'packageID': id,
      },
    );
  }

  static Future<void> sendEventName(String name) async {
    debugPrint("event Name  $name");
    await analytics.logEvent(
      name: name,
      parameters: {
        'email': getUserEmail(),
        'userID': getUserID(),
      },
    );
  }

  static Future<void> sendCurrentScreen(String screenName) async {
    await analytics.setCurrentScreen(
        screenName: '${screenName}_screen"}', screenClassOverride: screenName);
  }

  static Future<void> sendAppEnterEvent() async {
    await analytics.logAppOpen();
  }

  static Future<void> sendLoginEvent() async {
    await analytics.logLogin();
  }

  static Future<void> sendSearchLog(String searchTerm) async {
    await analytics.logSearch(
      searchTerm: searchTerm,
    );
  }

/* static Future<void> sendLikeOrDislikeEvent(
      bool isLike, ObjectItemType itemType) async {
    await sendEvent(isLike ? 'Like' : 'Dislike', {
      'item_type': TextUtils.enumStringValue(itemType.toString()),
      'time': DateTime.now().toUtc().toIso8601String(),
    });
  }*/
}

crowd analytics bug

Most helpful comment

I have the same problem. My custom events are visible only in the StreamView.

All 16 comments


flutter doctor -v

[βœ“] Flutter (Channel dev, 1.20.0-0.0.pre, on Mac OS X 10.15.5 19F101, locale
    en-GB)
    β€’ Flutter version 1.20.0-0.0.pre at /Users/tahatesser/Code/flutter_dev
    β€’ Framework revision d9653445f4 (6 days ago), 2020-06-09 18:43:03 -0400
    β€’ Engine revision e8c13aa012
    β€’ Dart version 2.9.0 (build 2.9.0-14.0.dev 5c1376615e)


[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    β€’ Android SDK at /Users/tahatesser/Code/sdk
    β€’ Platform android-30, build-tools 30.0.0
    β€’ ANDROID_HOME = /Users/tahatesser/Code/sdk
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 11.5)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Xcode 11.5, Build version 11E608c
    β€’ CocoaPods version 1.9.3

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 4.0)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin version 46.0.2
    β€’ Dart plugin version 193.7361
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[βœ“] VS Code (version 1.46.0)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.11.0

[βœ“] Connected device (5 available)
    β€’ SM M305F      β€’ 32003c30dc19668f          β€’ android-arm64  β€’ Android 10 (API 29)
    β€’ Taha’s iPhone β€’ 00008020-001059882212002E β€’ ios            β€’ iOS 13.5.1
    β€’ macOS         β€’ macOS                     β€’ darwin-x64     β€’ Mac OS X 10.15.5 19F101
    β€’ Web Server    β€’ web-server                β€’ web-javascript β€’ Flutter Tools
    β€’ Chrome        β€’ chrome                    β€’ web-javascript β€’ Google Chrome 83.0.4103.97

β€’ No issues found!

flutter doctor -v
[βœ“] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.2 19C57, locale en-IN)
β€’ Flutter version 1.17.1 at /Users/amit.prajapati/Documents/android/flutter/flutter
β€’ Framework revision f7a6a7906b (5 weeks ago), 2020-05-12 18:39:00 -0700
β€’ Engine revision 6bc433c6b6
β€’ Dart version 2.8.2

[βœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
β€’ Android SDK at /Users/amit.prajapati/Documents/android/sdk/
β€’ Platform android-R, build-tools 29.0.2
β€’ ANDROID_SDK_ROOT = /Users/amit.prajapati/Documents/android/sdk/
β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 11.3)
β€’ Xcode at /Applications/Xcode.app/Contents/Developer
β€’ Xcode 11.3, Build version 11C29
β€’ CocoaPods version 1.9.1

[βœ“] Android Studio (version 4.0)
β€’ Android Studio at /Applications/Android Studio.app/Contents
β€’ Flutter plugin version 46.0.2
β€’ Dart plugin version 193.7361
β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[βœ“] VS Code (version 1.45.1)
β€’ VS Code at /Applications/Visual Studio Code.app/Contents
β€’ Flutter extension version 3.11.0

[βœ“] Connected device (1 available)
β€’ Mi A1 β€’ 7e429b020404 β€’ android-arm64 β€’ Android 9 (API 28)

I have the same problem. My custom events are visible only in the StreamView.

Same issue.

Is anybody resolve this issue?

Same issue here, in debugView I don't see all events coming to firebase, but some of them appear in streamview

Same issue.

Same issue...

In my case, I added this code by mistake following firebase-messaging docs
This code causes preventing to collect analytics log.

AndroidManifest.xml

<meta-data
    android:name="firebase_messaging_auto_init_enabled"
    android:value="false" />

<meta-data
    android:name="firebase_analytics_collection_enabled"
    android:value="false" />

Actually, If you use firebase_messaging flutter packages, this code is not needed.
I think someone who added firebase_messaging recently should check if this code included in AndroidManifest.xml

hi! any news about it?

A quick check shows Firebase Analytics at version firebase_analytics: ^6.0.2.

Is this still an issue? We would recommend trying the latest version if issues are persisting on version 5.0.15

I have updated to 6.1.0 and was using 6.0.0 before.
On both versions none of my events are visible in firebase and no exceptions where thrown when logging analytics events.

Same here, using flutter. Don't know if I have to do something different

Same issue here =/

Same issue here, version 6.2.0. Events are visible just on StreamView.

*edited: for me, screen_view events are not visible, but others are still shown in debug view
Version 6.3.0

Was this page helpful?
0 / 5 - 0 ratings