Search code examples
flutterfirebasefirebase-analytics

Firebase Analytics(Events or Conversion) for 2 row data


I have a Flutter app. Normally, we can track events with one data. I want to track 2 data.

Normally with firebase we can track different events like:

  • screen_view
  • session_start
  • first_open
  • a
  • b

What do I want?

  • x | y together

How can I achieve this for my Flutter app in Firebase?

Must I use FireStore database? Is there way to do this with Firebase Analytics Events?


Solution

  • You can track events with multiple data or parameter by doing:

    await FirebaseAnalytics.instance.logEvent(
        name: "screen_view",
        parameters: {
            "x": "value_of_x",
            "y": "vallue_of_y",
        },
    );
    

    I used screen_view as sample event name. You can check the docs here for more.