firebase_analytics_monitor 1.0.1 copy "firebase_analytics_monitor: ^1.0.1" to clipboard
firebase_analytics_monitor: ^1.0.1 copied to clipboard

A command-line tool to monitor Firebase Analytics events from logcat.

πŸ”₯ Firebase Analytics Monitor (famon) #

coverage style: very good analysis License: MIT

A powerful command-line tool for real-time monitoring and filtering of Firebase Analytics events from Android logcat. Perfect for developers and QA engineers working with Firebase Analytics implementations.

✨ Features #

  • πŸ” Real-time monitoring: Stream Firebase Analytics events as they happen
  • 🎯 Smart filtering: Hide noisy events or show only specific ones
  • 🎨 Beautiful output: Colorized, well-formatted event display with emoji icons
  • πŸ“Š Smart suggestions: Get recommendations for filtering based on session data
  • πŸ“ˆ Session statistics: Track event frequency and patterns
  • ⚑ Event parsing: Comprehensive parsing of parameters and item arrays
  • πŸ›  Developer-friendly: Designed for debugging and analytics validation

πŸš€ Installation #

Global Installation via Pub #

dart pub global activate firebase_analytics_monitor

Local Development Installation #

dart pub global activate --source=path <path to this package>

From Source #

git clone <repository-url>
cd firebase_analytics_monitor
dart pub get
dart compile exe bin/famon.dart -o famon
# Move famon to your PATH

πŸ“‹ Prerequisites #

Before using famon, ensure you have:

  • βœ… Android SDK platform-tools installed
  • βœ… adb command available in your PATH
  • βœ… Android device or emulator connected
  • βœ… USB debugging enabled on your device
  • βœ… App with Firebase Analytics running

Verify your setup:

adb devices  # Should show your connected device
adb logcat -s FA-SVC | head  # Should show Firebase Analytics logs

🎯 Usage #

Basic Monitoring #

Monitor all Firebase Analytics events:

famon monitor

Filter Events #

Hide specific noisy events:

famon monitor --hide screen_view --hide _vs

Show only specific events:

famon monitor --show-only my_event --show-only another_event
# or using short form:
famon monitor -s my_event -s another_event

Advanced Options #

Monitor with smart suggestions and statistics:

famon monitor --suggestions --stats

Disable colors (useful for CI/CD or logging):

famon monitor --no-color

Get Help #

famon help           # Detailed help with examples
famon --help         # Basic usage information
famon --version      # Show version

πŸ“Š Example Output #

πŸ”₯ Firebase Analytics Monitor Started
πŸ“± Connecting to adb logcat...
Press Ctrl+C to stop monitoring

[12-25 10:30:45.123] my_custom_event
  Parameters:
    param_one: value1
    param_two: value2

[12-25 10:31:15.456] another_event
  Parameters:
    screen_name: SomeScreen
    screen_class: MainActivity

πŸ’‘ Smart Suggestions:
   Most frequent events: screen_view, _vs, app_update, user_engagement
   Consider hiding: screen_view, _vs
   Use: famon monitor --hide screen_view --hide _vs

πŸ“Š Session Stats:
   Unique Events: 8
   Total Events: 45

πŸ”§ Command Reference #

Monitor Command #

famon monitor [OPTIONS]

Options:

  • --hide EVENT_NAME: Hide specific event names (can be used multiple times)
  • -s, --show-only EVENT_NAME: Only show specified events (can be used multiple times)
  • --no-color: Disable colored output
  • --suggestions: Show smart filtering suggestions based on session data
  • --stats: Display session statistics periodically
  • --help: Show help for the monitor command

Global Options #

  • -v, --version: Show version information
  • --verbose: Enable verbose logging
  • --help: Show general help

πŸ§ͺ Testing Your Setup #

  1. Test adb connection:

    adb devices
    
  2. Test Firebase Analytics logs:

    adb logcat -s FA-SVC | head -20
    
  3. Test with sample events:

    • Open your app with Firebase Analytics
    • Navigate through screens or trigger events
    • Run famon monitor to see events in real-time

πŸ› Troubleshooting #

"adb: command not found" #

  • Install Android SDK platform-tools
  • Add platform-tools to your PATH

"No devices found" #

  • Connect your Android device via USB
  • Enable USB debugging in Developer Options
  • Try adb kill-server && adb start-server

"No Firebase Analytics events" #

  • Ensure your app has Firebase Analytics integrated
  • Check that events are being sent (may have delays)
  • Verify Firebase Analytics is properly configured

"Permission denied" errors #

  • Check USB debugging permissions on device
  • Try different USB cable or port

"Not all event parameters are showing" #

If you're seeing events but missing parameters, this could be due to:

  1. Log format variations: Firebase Analytics uses different log formats
  2. Parameter parsing issues: Complex parameter structures may need adjustment

To debug parameter parsing:

# First, check the raw Firebase Analytics logs
adb logcat -s FA-SVC | head -10

# Look for patterns like:
# Logging event: origin=app,name=EVENT_NAME,params=Bundle[{param1=value1, param2=value2}]

Common log formats supported:

  • Logging event: origin=app,name=EVENT_NAME,params=Bundle[{...}]
  • Event logged: EVENT_NAME params:Bundle[{...}]
  • FA-SVC event_name:EVENT_NAME

If parameters are still missing:

  1. Check if the Bundle format in your logs matches the expected patterns
  2. Some newer Firebase SDK versions may use different formats
  3. Parameters with special characters or nested objects may need additional parsing

Example of expected vs actual log format:

Expected:

Logging event: origin=app,name=view_cart,params=Bundle[{value=0, currency=GBP, login_mode=email_login}]

If your logs look different, please open an issue with a sample log line for format support.

🀝 Contributing #

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup #

git clone <repository-url>
cd firebase_analytics_monitor
dart pub get
dart pub run build_runner build  # Generate model files

Running Tests #

dart test                           # Run all tests
dart test --coverage=coverage      # Run with coverage
dart pub run test                  # Alternative test command

To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov)
.

```sh
# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

0
likes
70
points
165
downloads

Publisher

unverified uploader

Weekly Downloads

A command-line tool to monitor Firebase Analytics events from logcat.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

args, cli_completion, equatable, get_it, injectable, isar, mason_logger, path, process, pub_updater

More

Packages that depend on firebase_analytics_monitor