Flutter plugin for Google Analytics for Firebase, an app measurement solution that provides insight on app usage and user engagement on Android and iOS.
A Flutter plugin to use the Google Analytics for Firebase API .
For Flutter plugins for other Firebase products, see README.md .
Usage
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).
To track PageRoute transitions, add a FirebaseAnalyticsObserver to the list of NavigatorObservers on your Navigator, e.g. if you’re using a MaterialApp:
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 implementing RouteAware and subscribing it to FirebaseAnalyticsObserver. See example/lib/tabs_page.dart for an example of how to wire that up.
Getting Started
See the 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 .
To contribute a change to this plugin, please review our contribution guide , and send a pull request .
Download Google Analytics for Firebase Flutter plugin Source Code on GitHub
🔥 A collection of Firebase plugins for Flutter apps. https://github.com/firebase/flutterfire 4,095 forks. 9,127 stars. 207 open issues. Recent commits: test(ci): implement best practices for caching in workflows (#17930)* chore(ci): pin android emulator runner action to fixed SHAit was previously on the sliding v2 tag and could update to unknowncode without notice* chore(ci): only cache main – avoid branches LRU evicting main cacheuse the separate actions/cache "restore" and "save" actions so we mayonly save optional based on whether we are on main or notin the case of ccache-action, specify the optional `save` parameterimplementing the same "only save on main" criteriaactions/cache isolates branch caches from main to avoid branch cachepoison attacks on main runsbut branches may see main cache as those caches are considered trustworthybranch caches do consume available LRU storage though, meaning branch cachescould evict main caches and in high traffic / large cache repositories likethis one that means caches LRU out frequently and cache hit rates are terribleunless you cache on main only* chore(ci): cache restore/save failures should never break the buildvery occasionally, there are errors in the `hashFiles` function usedto calculate cache keys, and this causes a build error that is a flake,not a valid CI failure signalso, continue the workflow even if the caching setup has errors, asthat is a recoverable problem and the workflow may still have a validsuccess outcome* chore(ci): make github primary cache keys unique so caches updategithub workflow caches are considered immutable, they will never updateif there was a hit on the primary cache keyergo, if the primary cache key never changes the caches will never updateand you will only ever get fresh caches by chance if stale caches areevicted via LRU cache storage limit managementSo, all cache primary keys are unique now according to the requirements of the specificcache- the AVD cache is now unique on the api-level/target/arch tuple, and thatis set and referenced in an environment variable since it is now used in two places- the firebase emulator cache is set based on the firebase-tools version, which alwayschanges when new emulator versions are downloaded* chore(ci): firebase emulators are cross-platform, share cache across OSsthe downloaded/cached files are pure javascript and java, they may beshared across operating systems safely* style(lint): fix minor formatting errors , GitHub feat(firebase_ai): add thinking level to ThinkingConfig (#17937)* add the thinkingLevel api* Add test cases* Apply suggestions from code reviewCo-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>* more review feedback* more comments———Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> , GitHub fix(messaging, iOS): scope iOS 18 duplicate notification workaround to iOS 18.0 only (#17932)* fix(messaging, iOS): scope iOS 18 duplicate notification workaround to iOS 18.0 only* fix(messaging, ios): use message id for iOS 18 duplicate filter , GitHub fix(cloud_functions): enhance stream response types for better type safety (#17938) , GitHub fix(firebase_ai): add missing error exports for ServiceApiNotEnabled and QuotaExceeded (#17928)* fix(firebase_ai): add missing error exports for ServiceApiNotEnabled and QuotaExceeded* refactor(response_parsing_test): remove unused error import , GitHub
Provides the list of the opensource Flutter apps collection with GitHub repository.