firebase / flutterfire

πŸ”₯ A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.68k stars 3.97k forks source link

πŸ› [firebase_analytics] engagement_time_msec is not tracked when logging screen_view #10863

Closed hbali closed 7 months ago

hbali commented 1 year ago

Bug report

Describe the bug I'm measuring screen views by calling

FirebaseAnalytics.instance.logEvent(
        name: 'screen_view',
        parameters: {
          'screen_name': screen.name,
          'screen_class': screen.screenClass,
          'firebase_screen': screen.name,
          'firebase_screen_class': screen.screenClass,
        },
      );

As mentioned in this article and this documentation, the engagement_time_msec should be tracked (the conditions are met because firebase_previous_screen and firebase_screen is different when I check in BigQuery).

Steps to reproduce

Steps to reproduce the behavior:

  1. Track screen_view event with logEvent method
  2. Checking the result in BigQuery, engagement_time_msec is not present in the event_params column

Expected behavior

engagement_time_msec should be present in the event_params column.

Sample project

A sample project requires a new Google Cloud project to setup as well so I will not include it here.


Additional context

I tried enabling/disabling FirebaseAutomaticScreenReportingEnabled but there is no change. Also tried setCurrentScreen method as well.

image


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [βœ“] Flutter (Channel stable, 3.7.11, on macOS 13.2.1 22D68 darwin-arm64, locale en-JP) [!] Android toolchain - develop for Android devices (Android SDK version 33.0.2) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [βœ“] Xcode - develop for iOS and macOS (Xcode 14.2) [βœ—] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [βœ“] Android Studio (version 2022.2) [βœ“] VS Code (version 1.77.3) [βœ“] Connected device (2 available) [βœ“] HTTP Host Availability ! Doctor found issues in 2 categories. ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 2.19.6 Flutter SDK 3.7.11 penmark 4.16.0+23518 dependencies: - adjust_sdk 4.33.1 [flutter meta] - app_settings 4.2.0 [flutter] - badges 3.0.3 [flutter] - bloc_concurrency 0.2.1 [bloc stream_transform] - cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - calendar_date_picker2 0.2.5 [flutter] - camera 0.10.3+2 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle quiver] - carousel_slider 4.2.1 [flutter] - cloud_firestore 4.5.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 4.1.0 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - connectivity 3.0.6 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web] - crypto 3.0.2 [typed_data] - cupertino_icons 1.0.5 - date_utils 0.2.0 [intl] - device_calendar 4.3.1 [flutter collection sprintf timezone flutter_native_timezone] - device_info 2.0.3 [flutter device_info_platform_interface] - dio 5.1.1 [http_parser meta path] - extended_image 7.0.2 [extended_image_library flutter meta] - file_picker 5.2.7 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - firebase_analytics 10.2.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.4.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.10.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.1.0 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_dynamic_links 5.1.0 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_in_app_messaging 0.7.1 [firebase_core firebase_core_platform_interface firebase_in_app_messaging_platform_interface flutter meta] - firebase_messaging 14.4.0 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_performance 0.9.1 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - firebase_remote_config 4.0.0 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - firebase_storage 11.1.0 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flushbar 1.10.4 [flutter] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_absolute_path 1.0.6 [flutter] - flutter_bloc 8.1.2 [flutter bloc provider] - flutter_html 3.0.0-alpha.6 [html csslib collection numerus flutter] - flutter_inappwebview 5.7.2+3 [flutter] - flutter_line_sdk 2.3.2 [flutter] - flutter_linkify 5.0.2 [flutter linkify] - flutter_local_notifications 13.0.0 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_localization 0.1.10 [flutter flutter_web_plugins flutter_localizations plugin_platform_interface shared_preferences] - flutter_quill 7.1.10 [flutter collection flutter_colorpicker flutter_keyboard_visibility quiver url_launcher pedantic characters diff_match_patch i18n_extension device_info_plus platform pasteboard] - flutter_quill_extensions 0.3.0 [flutter flutter_quill image_picker photo_view video_player youtube_player_flutter gallery_saver math_keyboard string_validator url_launcher] - flutter_simple_dependency_injection 2.0.0 - flutter_slidable 2.0.0 [flutter] - flutter_sticky_header 0.6.5 [flutter value_layout_builder] - flutter_svg 2.0.5 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - flutter_web_browser 0.17.1 [flutter] - font_awesome_flutter 10.4.0 [flutter] - google_mobile_ads 2.4.0 [meta flutter visibility_detector] - google_sign_in 6.0.2 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - http 0.13.5 [async http_parser meta path] - image_cropper 3.0.2 [flutter image_cropper_platform_interface image_cropper_for_web] - image_gallery_saver 1.7.1 [flutter] - image_picker 0.8.7+1 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface] - in_app_review 2.0.6 [flutter in_app_review_platform_interface] - intl 0.17.0 [clock path] - just_the_tooltip 0.0.12 [flutter] - line_awesome_flutter 2.0.0 [flutter] - metadata_fetch 0.4.1 [http string_validator html] - mime 1.0.4 - modal_bottom_sheet 3.0.0-pre [flutter] - multi_image_picker2 5.0.02 [flutter] - notification_permissions 0.6.1 [flutter] - open_filex 4.3.2 [flutter ffi] - package_info 2.0.2 [flutter] - path_provider 2.0.14 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - pdf_render 1.3.8 [collection flutter flutter_web_plugins js plugin_platform_interface vector_math] - permission_handler 10.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - quiver 3.2.1 [matcher] - scrollable_positioned_list 0.3.5 [flutter collection] - share_plus 6.3.1 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32] - shared_preferences 2.1.0 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shimmer 2.0.0 [flutter] - sign_in_with_apple 4.3.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web] - sliding_sheet 0.5.2 [flutter] - store_redirect 2.0.1 [flutter] - transparent_image 2.0.1 - tuple 2.0.1 - tutorial_coach_mark 1.2.8 [flutter flutter_lints] - twitter_login 4.3.1 [flutter crypto http] - url_launcher 6.1.10 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - version 3.0.2 dev dependencies: - test 1.22.0 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core] dependency overrides: - flutter_svg 2.0.5 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - string_validator 1.0.0 transitive dependencies: - _fe_analyzer_shared 58.0.0 [meta] - _flutterfire_internals 1.1.1 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 5.10.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - args 2.4.0 - async 2.10.0 [collection meta] - bloc 8.1.1 [meta] - boolean_selector 2.1.1 [source_span string_scanner] - cached_network_image_platform_interface 2.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.0.2 [flutter flutter_cache_manager cached_network_image_platform_interface] - camera_android 0.10.5 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform] - camera_avfoundation 0.9.13+1 [camera_platform_interface flutter stream_transform] - camera_platform_interface 2.5.0 [cross_file flutter plugin_platform_interface stream_transform] - camera_web 0.3.1+3 [camera_platform_interface flutter flutter_web_plugins stream_transform] - characters 1.2.1 - clock 1.1.1 - cloud_firestore_platform_interface 5.12.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 3.4.0 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - cloud_functions_platform_interface 5.2.0 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.4.0 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - collection 1.17.0 - connectivity_for_web 0.4.0+1 [connectivity_platform_interface flutter_web_plugins flutter] - connectivity_macos 0.2.1+2 [flutter connectivity_platform_interface] - connectivity_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service] - cross_file 0.3.3+4 [js meta] - csslib 0.17.2 [source_span] - dbus 0.7.8 [args ffi meta xml] - device_info_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - device_info_plus 8.1.0 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - diff_match_patch 0.4.1 - equatable 2.0.5 [collection meta] - extended_image_library 3.4.1 [crypto flutter http_client_helper path path_provider] - fake_async 1.3.1 [clock collection] - ffi 2.0.1 - file 6.1.4 [meta path] - firebase_analytics_platform_interface 3.4.1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.2+1 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 6.13.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.3.0 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.6.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.3.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.4.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.4 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_in_app_messaging_platform_interface 0.2.2 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.3.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.3.0 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_performance_platform_interface 0.1.2 [_flutterfire_internals firebase_core flutter plugin_platform_interface] - firebase_performance_web 0.1.2 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - firebase_remote_config_platform_interface 1.2.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.2.0 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - firebase_storage_platform_interface 4.2.0 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.4.0 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - flutter_blurhash 0.7.0 [flutter] - flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_colorpicker 1.0.3 [flutter] - flutter_keyboard_visibility 5.4.0 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_linux flutter_keyboard_visibility_macos flutter_keyboard_visibility_web flutter_keyboard_visibility_windows flutter] - flutter_keyboard_visibility_linux 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_macos 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter] - flutter_keyboard_visibility_windows 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_lints 2.0.1 [lints] - flutter_local_notifications_linux 3.0.0+1 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories] - flutter_local_notifications_platform_interface 6.0.0 [flutter plugin_platform_interface] - flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math] - flutter_math_fork 0.6.3+1 [flutter flutter_svg provider meta collection tuple] - flutter_native_timezone 2.0.0 [flutter_web_plugins flutter js] - flutter_plugin_android_lifecycle 2.0.9 [flutter] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - frontend_server_client 3.2.0 [async path] - gallery_saver 2.3.2 [flutter path_provider http path] - glob 2.1.1 [async collection file path string_scanner] - google_identity_services_web 0.2.1 [js meta] - google_sign_in_android 6.1.8 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.6.1 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.4.0 [flutter plugin_platform_interface quiver] - google_sign_in_web 0.11.0+2 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http js] - holding_gesture 1.1.0 [flutter] - html 0.15.2 [csslib source_span] - http_client_helper 2.0.3 [http] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - i18n_extension 8.0.0 [sprintf args equatable intl flutter] - image_cropper_for_web 1.0.3 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 3.0.3 [flutter plugin_platform_interface http] - image_picker_android 0.8.6+6 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 2.1.12 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_ios 0.8.7+2 [flutter image_picker_platform_interface] - image_picker_platform_interface 2.6.3 [cross_file flutter http plugin_platform_interface] - in_app_review_platform_interface 2.0.4 [flutter url_launcher plugin_platform_interface platform] - io 1.0.4 [meta path string_scanner] - js 0.6.5 [meta] - linkify 4.1.0 - lints 2.0.1 - logging 1.1.1 - matcher 0.12.13 [meta stack_trace] - material_color_utilities 0.2.0 - math_expressions 2.4.0 [vector_math] - math_keyboard 0.1.9 [flutter flutter_localizations flutter_math_fork holding_gesture intl math_expressions petitparser] - meta 1.8.0 - nested 1.0.0 [flutter] - node_preamble 2.0.2 - numerus 2.0.0 [characters] - octo_image 1.0.2 [flutter flutter_blurhash] - package_config 2.1.0 [path] - pasteboard 0.2.0 [flutter flutter_web_plugins js] - path 1.8.2 - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.0.24 [flutter path_provider_platform_interface] - path_provider_foundation 2.2.1 [flutter path_provider_platform_interface] - path_provider_linux 2.1.10 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.0.6 [flutter platform plugin_platform_interface] - path_provider_windows 2.1.5 [ffi flutter path path_provider_platform_interface win32] - pedantic 1.11.1 - permission_handler_android 10.2.0 [flutter permission_handler_platform_interface] - permission_handler_apple 9.0.8 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.9.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.2 [flutter permission_handler_platform_interface] - petitparser 5.1.0 [meta] - photo_view 0.14.0 [flutter] - platform 3.1.0 - plugin_platform_interface 2.1.4 [meta] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - provider 6.0.5 [collection flutter nested] - pub_semver 2.1.3 [collection meta] - rxdart 0.27.7 - share_plus_platform_interface 3.2.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences_android 2.1.0 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.2.0 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.2.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.2.0 [flutter plugin_platform_interface] - shared_preferences_web 2.1.0 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.2.0 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.0 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 3.0.1 [path shelf shelf_static] - shelf_static 1.1.1 [convert http_parser mime path shelf] - shelf_web_socket 1.0.3 [shelf stream_channel web_socket_channel] - sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta] - sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js] - sky_engine 0.0.99 - source_map_stack_trace 2.1.1 [path source_maps stack_trace] - source_maps 0.10.12 [source_span] - source_span 1.9.1 [collection path term_glyph] - sprintf 7.0.0 - sqflite 2.2.6 [flutter sqflite_common path] - sqflite_common 2.4.3 [synchronized path meta] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - synchronized 3.0.1 - term_glyph 1.2.1 - test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - test_core 0.4.20 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api] - timezone 0.9.1 [path] - typed_data 1.3.1 [collection] - url_launcher_android 6.0.26 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.3 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.4 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.4 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.2 [flutter plugin_platform_interface] - url_launcher_web 2.0.16 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.5 [flutter url_launcher_platform_interface] - uuid 3.0.7 [crypto] - value_layout_builder 0.3.1 [flutter] - vector_graphics 1.1.5 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.5 - vector_graphics_compiler 1.1.5 [args meta path_parsing xml vector_graphics_codec] - vector_math 2.1.4 - video_player 2.6.1 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web] - video_player_android 2.4.4 [flutter video_player_platform_interface] - video_player_avfoundation 2.4.3 [flutter video_player_platform_interface] - video_player_platform_interface 6.1.0 [flutter plugin_platform_interface] - video_player_web 2.0.16 [flutter flutter_web_plugins video_player_platform_interface] - visibility_detector 0.3.3 [flutter] - vm_service 9.4.0 - watcher 1.0.2 [async path] - web_socket_channel 2.3.0 [async crypto stream_channel] - webkit_inspection_protocol 1.2.0 [logging] - win32 3.1.3 [ffi] - xdg_directories 0.2.0+3 [meta path process] - xml 6.2.2 [collection meta petitparser] - yaml 3.1.1 [collection source_span string_scanner] - youtube_player_flutter 8.1.2 [flutter flutter_inappwebview]```

darshankawar commented 1 year ago

Thanks for the report @hbali

2. Checking the result in BigQuery,

Is this being observed only when the events are captured in BigQuery ? or in firebase console too ? Can you also confirm that firebase events captured in BigQuery are in which format ? What type does it ideally should appear in BigQuery ?

We actually pass the values straight to logEvent with next to no type checking on values.

hbali commented 1 year ago

@darshankawar Thank you for the reply!

Is this being observed only when the events are captured in BigQuery ? or in firebase console too ?

Firebase console doesn't show these parameters, only the ones I have set explicitly, (at least I couldn't find it) however it shows the engagement time for each screen. I know there is a way to calculate the engagement time based on the event_timestamp and doing LEAD with other rows previous_event_timestamp and calculating the difference so I'm not sure what Firebase is using internally. (so while this is a solution, I'd still prefer doing less queries and just directly getting the engagement time)

Can you also confirm that firebase events captured in BigQuery are in which format ?

Not sure what you mean exactly by format but I attached a screenshot of a row of the screen_view event. I would expect engagement_time_msec to be in the event_parameteres column.

image

What type does it ideally should appear in BigQuery ?

Ideal type is just a new row inside the event_parameters (it's a nested array) and then the value itself should be in event_params.value.int_value as milliseconds. Interestingly user_engagement has the parameter that I'm looking for: Basically I want the same in screen_view too image

I was debating whether to put this issue in the native SDK github or here but since we are only using the native one indirectly I put it here for the time being.

As a side question, can you confirm which method should we call to track screen views? There is setCurrentScreen, logScreenView and the manual logEvent with setting the event name to screen_view. I don't quite understand which is the latest, but checking the source code there seems to be not much difference between them.

darshankawar commented 1 year ago

Thanks for the update. Keeping this issue open for expected behavior from client side on the parameter being sent.

/cc @russellwheatley

russellwheatley commented 9 months ago

@hbali - This isn't something FlutterFire has an influence on.

here is a closed issue on firebase-android-sdk which explains how engagement_time_msec is calculated: https://github.com/firebase/firebase-android-sdk/issues/3933#issuecomment-1192836562

Quote:

As for the screen_view event, this doesn't always contain the engagement_time_msec. We sometimes move engagement_time_msec event with other events such as screen view events to avoid logging a redundant engagement event. As a result your screen_view event sometimes might have an engagement_time_msec, but not always.

On iOS, I found this issue which said it wasn't yet available on the firebase-ios-sdk: https://github.com/firebase/firebase-ios-sdk/issues/7083. Although this is 2 years old so might be worth asking if this is supported.

It is worth filing an issue with Firebase support and perhaps clarifying why the screen name change isn't causing the engagement_time_msec to appear in the data.

Lyokone commented 7 months ago

I'll close this issue since it's blocked by Firebase SDK and we will not be fixing this.