Flutter log event with google analytics

5,578

When You log an event with FirebaseAnalytics, it takes up to 24 hours to get it available in the Events dashboard.

If You want to test "real time" logging, You should try the Debug View (link).

After You set it up for a specific device (there are two easy steps, check it out here), You will see each event only a few seconds after You log it from Your app, in the DebugView section.

enter image description here

Share:
5,578
Michael Johnston
Author by

Michael Johnston

Updated on December 18, 2022

Comments

  • Michael Johnston
    Michael Johnston over 1 year

    I have set up Google Analytics with in my flutter app. It all seems to be working as standard, with data coming through and being displayed on the analytics console screen, showing users, events count that sort of thing.

    I see the default events are: user_engagement, screen_view, session_start, first_open, app_remove, app_clear_data.

    These are all having event count data coming through fine. I want to set up my own custom event within the flutter app. I have tried this...

    _sendAnalyticsEvent() async {
        FirebaseAnalytics analytics = FirebaseAnalytics();
    
        await analytics.logEvent(
          name: "save_plant",
          parameters: <String, dynamic>{
            'plant_name': currentPlant.name,
            'plant_species': currentPlant.species,
            'plant_group': currentPlant.group,
            'new_plant': widget.newPlant
          },
        );
      }
    

    ... but nothing seems to be coming through on the events. Am I missing something here with doing custom events with a flutter app? I have the google-services.json file correctly in the android app directory.