Google Analytics for Firebase #
A Flutter plugin to use the Google Analytics for Firebase API.
For Flutter plugins for other Firebase products, see README.md.
To use this plugin, add
firebase_analytics as a dependency in your pubspec.yaml file. You must also configure firebase analytics for each platform project: Android and iOS (see the example folder or https://codelabs.developers.google.com/codelabs/flutter-firebase/#4 for step by step details).
Track PageRoute Transitions #
PageRoute transitions, add a
FirebaseAnalyticsObserver to the list of
NavigatorObservers on your
Navigator, e.g. if you're using a
FirebaseAnalytics analytics = FirebaseAnalytics(); MaterialApp( home: MyAppHome(), navigatorObservers: [ FirebaseAnalyticsObserver(analytics: analytics), ], );
You can also track transitions within your
PageRoute (e.g. when the user switches from one tab to another) by
RouteAware and subscribing it to
for an example of how to wire that up.
Getting Started #
example directory for a complete sample app using Google Analytics for Firebase.
Issues and feedback #
Please file Flutterfire specific issues, bugs, or feature requests in our issue tracker.
Plugin issues that are not specific to Flutterfire can be filed in the Flutter issue tracker.
- Keep a local registrar to get activity for foreground actions for v1 embedder.
- Remove the deprecated
author:field from pubspec.yaml
- Migrate the plugin to the pubspec platforms manifest.
- Bump the minimum Flutter version to 1.10.0.
- Update homepage since the package moved for the platform interface migration.
- Updated README instructions for contributing for consistency with other Flutterfire plugins.
- Remove AndroidX warning.
- Include lifecycle dependency as a compileOnly one on Android to resolve potential version conflicts with other transitive libraries.
- Support the v2 Android embedding.
- Update documentation to reflect new repository location.
- Update unit tests to call
- Remove executable bit on LICENSE file.
- Breaking change. Remove deprecated method
- Breaking change. Removed
- Update Android gradle plugin and gradle version.
- Remove redundant casts on Android.
- Update google-services Android gradle plugin to 4.3.0 in documentation and examples.
- Refactor unit tests to use
- Added new tracking events:
- Breaking change. Add new required parameter
- Breaking change. The following event names are reserved and cannot be used:
- Automatically use version from pubspec.yaml when reporting usage to Firebase.
- Bump minimum Flutter version to 1.5.0.
- Add missing template type parameter to
- Switch to using the
setAnalyticsCollectionEnabledfor compatibility with Firebase Analytics iOS CocoaPod version 6.0.
- Update podspec to ensure availability of
- Update Android dependencies to latest.
- Added an initial integration test.
- Fixed errors in code sample for
- Added hyperlinks to example app reference in README.md.
- Added screen_view tracking of Navigator.pushReplacement
- Add Login event support
- Add resetAnalyticsData method
- Log messages about automatic configuration of the default app are now less confusing.
- Enable setAnalyticsCollectionEnabled support for iOS
- Log a more detailed warning at build time about the previous AndroidX migration.
Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.
This was originally incorrectly pushed in the
- Revert the breaking 1.2.0 update. 1.2.0 was known to be breaking and
should have incremented the major version number instead of the minor. This
revert is in and of itself breaking for anyone that has already migrated
however. Anyone who has already migrated their app to AndroidX should
immediately update to
2.0.0instead. That's the correctly versioned new push of
BAD. This was a breaking change that was incorrectly published on a minor version upgrade, should never have happened. Reverted by 1.2.0+1.
"Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library."
- Allow user to handle
PlatformExceptions caught by
- Allow user ID to be set to null.
- Update the
METHODAndroid constant used for
- Bump Android dependencies to latest.
- Updated test and mockito dependencies to pick up Dart 2 support
- Bump Android and Firebase dependency versions.
- Updated Gradle tooling to match Android Studio 3.1.2.
- Bump to released version.
- Updated Google Play Services dependencies to version 15.0.0.
- Updated package channel name
- Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives.
- Breaking change. Set SDK constraints to match the Flutter beta release.
- Enabled use in Swift projects.
- Updated description to clarify this is 'Google Analytics for Firebase'
- Moved to the io.flutter.plugins organization.
- Simplified and upgraded Android project template to Android SDK 27.
- Updated package description.
- Breaking change. Upgraded to Gradle 4.1 and Android Studio Gradle plugin 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in order to use this version of the plugin. Instructions can be found here.
- Relaxed GMS dependency to [11.4.0,12.0[
- Added FLT prefix to iOS types
- Change GMS dependency to 11.4.+
- Change GMS dependency to 11.+
- Aligned author name with rest of repo.
NavigatorObserver) to automatically log
- Support for long parameter values on Android
- Updated to Firebase SDK to always use latest patch version for 11.0.x builds
- Updated to Firebase SDK Version 11.0.1
- Bumped buildToolsVersion to 25.0.3
- Updated README.md
- Initial Release
Demonstrates how to use the firebase_analytics plugin.
Getting Started #
For help getting started with Flutter, view our online documentation.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: firebase_analytics: ^5.0.10
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jan 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.4
- Flutter: 1.12.13+hotfix.5
|Dart SDK||>=2.0.0-dev.28.0 <3.0.0|