Skip to content

Comments

Add Firebase Analytics with screen view tracking#1011

Merged
gregmarra merged 1 commit intomainfrom
add-firebase-analytics
Feb 10, 2026
Merged

Add Firebase Analytics with screen view tracking#1011
gregmarra merged 1 commit intomainfrom
add-firebase-analytics

Conversation

@gregmarra
Copy link
Contributor

Summary

  • Adds firebase-analytics-ktx dependency (already in version catalog, just not wired up)
  • Disables automatic Activity-based screen reporting (useless in single-Activity Compose apps — everything shows as "MainActivity")
  • Manually logs SCREEN_VIEW events via a NavController.OnDestinationChangedListener in TBAApp, mapping all 13 destinations to readable screen names (Events, Teams, EventDetail, etc.)
  • Disables analytics collection in debug builds to avoid polluting production data

Test plan

  • ./gradlew :app:assembleDebug builds successfully
  • ./gradlew :app:testDebugUnitTest passes
  • Installed on emulator, navigated between screens
  • Logcat confirms FA: Logging screen view with name, class: Events, MainActivity events are generated
  • Debug builds correctly suppress collection (Event not sent since app measurement is disabled)

🤖 Generated with Claude Code

Single-Activity Compose apps report all screens as "MainActivity" with
automatic tracking, which is useless. This disables automatic reporting
and manually logs SCREEN_VIEW events via a NavController
OnDestinationChangedListener, mapping each destination to a readable
screen name (Events, Teams, EventDetail, etc.).

Analytics collection is disabled in debug builds to avoid polluting
production data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gregmarra gregmarra force-pushed the add-firebase-analytics branch from 88ea5d0 to 23a8de0 Compare February 10, 2026 03:54
@gregmarra gregmarra merged commit 2b794c6 into main Feb 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant