firebase / firebase/firebase-ios-sdk

[AnalyticsScreenViews] Enable developers to indicate which of their view controller classes serve purely as containers

Open
#14,520 1 comment 0 reactions 0 assignees View on GitHub
api: analytics type: feature request
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 14h
Merged PRs (30d)
72

Description

OBSERVED:
I have a `UIViewController` subclass, `CustomTabBarController` for example, that serves as a sort of custom `UITabBarController`-esque container view controller. I have already added code to `CustomTabBarController` to manually report screen view events when it detects a new child is being displayed, however, the `CustomTabBarController` itself is still being reported in screen view analytics. Having `CustomTabBarController` appear in the screen view events is undesirable because it doesn't tell me anything about what the user is doing. It would be like reporting `UINavigationController`.

DESIRED:
I would like my `CustomTabBarController` class to not be included in screen view event collection the same way a `UINavigationController` or `UITabBarController` is not included. I would also like to avoid having to completely turn off automatic screen reporting in order to avoid having to add manual screen recording to all my view controllers.

PROPOSED SOLUTION:
Perhaps my `CustomTabBarController` class could adhere to a new protocol defined in FirebaseAnalytics named something like `ExemptFromScreenViewEvents` and any view controller class that adheres to that protocol is not included in screen view events. Or, perhaps I could set some static property on the analytics objects communicating that my class, `CustomTabBarController`, should not be included in screen view events?

NOTES:
Relevant published documentation: https://firebase.google.com/docs/analytics/screenviews#automatically_track_screens

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.