firebase-analytics
Skill669 starsChanged 3 months agoMITView on GitHub
Use when logging analytics events, setting user properties, configuring default event parameters, building funnels, or adding screen-view tracking.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- firebase/agent-skillstheir own version, first seen Nov 8, 2026
- DentVega/firebase-agent-skillstheir own version, first seen Oct 15, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- firebase/agent-skills★ 506same name
- DentVega/firebase-agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibilitySkill
- architecture-feature-firstSkill
- blocSkill
- code-reviewSkill
- dart-3-updatesSkill
- developing-genkit-dartSkill
- effective-dartSkill
- firebase-aiSkill
- firebase-app-checkSkill
- firebase-authSkill
- firebase-cloud-firestoreSkill
- firebase-cloud-functionsSkill
- firebase-crashlyticsSkill
- firebase-databaseSkill
- firebase-data-connectSkill
- firebase-in-app-messagingSkill
- firebase-messagingSkill
- firebase-remote-configSkill
- firebase-storageSkill
- flutter-app-architectureSkill
- flutter-best-practicesSkill
- flutter-change-notifierSkill
- flutter-errorsSkill
- flutterfire-configureSkill
- flutter-pre-cachingSkill
- flutter-use-column-row-firstSkill
- generate-images-with-firebase-aiSkill
- inclusive-designSkill
- mockitoSkill
- mocktailSkill
- patrol-e2e-testingSkill
- providerSkill
- revenuecat-testingSkill
- riverpodSkill
- testingSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill when:
- Distinctive: line 63
Run the app and check the Firebase DebugView console for incoming events.
- Distinctive: line 70
Use predefined event methods when possible for maximum detail in reports and access to future Google Analytics features:
- Very specific: line 79
Use the general logEvent() method for both predefined and custom events:
- Distinctive: line 149
Create custom definitions for user properties in the Analytics console before using them.
- Distinctive: line 151
Use user properties for audience segmentation, report filtering, or A/B test targeting.
- Distinctive: line 157
Request necessary permissions: before collecting user data, especially on platforms with strict privacy controls.
- Distinctive: line 159
Use consistent naming conventions (snake_case) for custom events and parameters.
- Distinctive: line 161
Use DebugView in the Firebase console during development — enable it on a physical device with:
- Very specific: line 163
iOS: Add -FIRDebugEnabled to scheme arguments in Xcode.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Firebase Analytics Skill
This skill defines how to correctly implement Firebase Analytics in Flutter applications, covering setup, event logging, user properties, and data collection best practices.
When to Use
Use this skill when:
- Setting up and configuring Firebase Analytics in a Flutter project.
- Logging predefined or custom analytics events.
- Setting user properties or default event parameters.
- Implementing screen view tracking with GoRouter or Navigator observers.
- Building conversion funnels or tracking user flows.
1. Setup and Configuration
flutter pub add firebase_analytics
flutter runimport 'package:firebase_analytics/firebase_analytics.dart';
// After Firebase.initializeApp():
FirebaseAnalytics analytics = FirebaseAnalytics.instance;- Initialize Firebase before using any Firebase Analytics features.
- Analytics automatically logs some events and user properties — no additional code needed for those.
- On iOS, if your app does not use the IDFA (Advertising Identifier), use the IDFA-free Analytics dependency (
FirebaseAnalyticsCoreunder Swift Package Manager, orFirebaseAnalytics/Coreunder CocoaPods) instead of the defaultFirebaseAnalyticsdependency to avoid App Store review questions about advertising identifiers:- Swift Package Manager: set
FIREBASE_ANALYTICS_WITHOUT_ADID=truewhen building (FIREBASE_ANALYTICS_WITHOUT_ADID=true flutter build ios).
- Swift Package Manager: set
Add Navigator Observer for Automatic Screen Tracking
MaterialApp(
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance),
],
);For GoRouter, log screen views manually on route changes:
GoRouter(
observers: [FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance)],
);Verification Checklist
- Confirm
Firebase.initializeApp()completes before accessingFirebaseAnalytics.instance. - Run the app and check the Firebase DebugView console for incoming events.
- Confirm automatic events (
first_open,session_start) appear without extra code.
2. Event Logging
Use predefined event methods when possible for maximum detail in reports and access to future Google Analytics features:
await FirebaseAnalytics.instance.logSelectContent(
contentType: "image",
itemId: itemId,
);Use the general logEvent() method for both predefined and custom events:
await FirebaseAnalytics.instance.logEvent(
name: "select_content",
parameters: {
"content_type": "image",
"item_id": itemId,
},
);Custom Event Example — E-commerce Add-to-Cart
Future<void> logAddToCart(String productId, String productName, double price) async {
await FirebaseAnalytics.instance.logEvent(
name: 'add_to_cart',
parameters: {
'product_id': productId,
'product_name': productName,
'price': price,
'currency': 'USD',
},
);
}- Event names are case-sensitive — names differing only in case create two distinct events.
- Up to 500 different event types with no limit on total event volume.
- Event names must start with an alphabetic character, contain only alphanumeric characters and underscores, and be no longer than 40 characters.
3. Parameters and Properties
- Parameter names: up to 40 characters, must start with an alphabetic character, contain only alphanumeric characters and underscores.
- String parameter values: up to 100 characters.
- The prefixes
firebase_,google_, andga_are reserved — do not use them for parameter names. - Up to 25 custom parameters per event.
- Register custom parameters in the Analytics console to use them as dimensions or metrics in reports.
Set default parameters for all future events (not supported on web):
await FirebaseAnalytics.instance.setDefaultEventParameters({
'app_version': '1.2.3',
'environment': 'production',
});Clear a default parameter by setting it to null.
4. User Properties
await FirebaseAnalytics.instance.setUserProperty(
name: 'favorite_food',
value: favoriteFood,
);Set the user ID to correlate events across devices:
await FirebaseAnalytics.instance.setUserId(id: 'user_12345');- Create custom definitions for user properties in the Analytics console before using them.
- Up to 25 custom user properties per project.
- Use user properties for audience segmentation, report filtering, or A/B test targeting.
5. Best Practices
- Request necessary permissions before collecting user data, especially on platforms with strict privacy controls.
- Never log sensitive or personally identifiable information in events or user properties.
- Use consistent naming conventions (snake_case) for custom events and parameters.
- Group related events to track user flows and conversion funnels.
- Use DebugView in the Firebase console during development — enable it on a physical device with:
- Android:
adb shell setprop debug.firebase.analytics.app <package_name> - iOS: Add
-FIRDebugEnabledto scheme arguments in Xcode.
- Android:
- Test analytics implementation before deploying to production by confirming events appear in DebugView.
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

