Skip to content

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

Open
@JValldejuli

Description

@JValldejuli

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions