In the previous XML-based Android development, it was relatively straightforward to track screen views in Google Analytics by using separate activities for each screen.
Now that I’m using Jetpack Compose with a single-activity architecture and Navigation Compose, I'm not sure what the best approach is to track screen views.
How can I properly track screen views in Jetpack Compose using Google Analytics (e.g., Firebase Analytics)?
Are there any recommended best practices or patterns for this in a Compose + Navigation setup?
Should I track the screens manually using NavBackStackEntry, or is there a better built-in way?
I’m looking for a clean and scalable solution that works well with modern Compose apps. Any advice, code snippets, or official recommendations would be really helpful.