Skip to content

Conversation

@sbarrio
Copy link
Contributor

@sbarrio sbarrio commented Nov 28, 2025

What does this PR do?

This PR modifies the automatic navigation tracking modules for React Navigation and React Native Navigation and exposes a new NavigationTrackingOptions parameter through the startTracking/startTrackingViews function.

This options object allows to customize the view tracking logic via 3 new optional predicate functions:

  • ViewNamePredicate - a custom naming predicates that decide the display name of views tracked by RUM.
  • ViewTrackingPredicate - a custom predicate that decides if a view needs to be tracked by RUM or not.
  • ParamsTrackingPredicate - a custom predicate that decides which navigation parameters (if any) need to be tracked alongside the view on RUM.

All of these are optional, and when not set the default behavior will be used for each one of them. The default behaviours are as follows:

  • ViewNamePredicate - directly forwards the view given name to RUM.
  • ViewTrackingPredicate - tracks all views on RUM.
  • ParamsTrackingPredicate - does not forward any parameters to RUM.

Motivation

Many users have expressed the need to be able to customize their view tracking configuration. Hopefully these changes will give them the tools that they need to do so without having to rely on patching files directly.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@sbarrio sbarrio changed the base branch from develop to feature/v3 November 28, 2025 16:00
@sbarrio sbarrio changed the base branch from feature/v3 to sbarrio/internal/update-v3-with-latest-from-develop November 28, 2025 16:00
@sbarrio sbarrio marked this pull request as ready for review November 28, 2025 16:15
@sbarrio sbarrio requested a review from a team as a code owner November 28, 2025 16:15
@sbarrio sbarrio self-assigned this Nov 28, 2025
@sbarrio sbarrio changed the title [RUM 11677] [V3] Add custom navigation tracking options [RUM-11677] [V3] Add custom navigation tracking options Nov 28, 2025
Base automatically changed from sbarrio/internal/update-v3-with-latest-from-develop to feature/v3 December 9, 2025 08:53
@sbarrio sbarrio dismissed marco-saia-datadog’s stale review December 9, 2025 08:53

The base branch was changed.

@sbarrio sbarrio force-pushed the sbarrio/RUM-11677/add-navigation-tracking-options branch 2 times, most recently from e9f158c to 4f1f09c Compare December 9, 2025 12:02
};
DdRumReactNavigationTracking.viewNamePredicate = defaultViewNamePredicate;
DdRumReactNavigationTracking.viewTrackingPredicate = defaultViewTrackingPredicate;
DdRumReactNavigationTracking.paramsTrackingPredicate = defaultParamsPredicate;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @marco-saia-datadog. I had forgotten this bit that resets the predicates when stopTracking is called from the previous version you had already reviewed. Apart from that everything is the same.

@sbarrio sbarrio force-pushed the sbarrio/RUM-11677/add-navigation-tracking-options branch from 4f1f09c to 03545dc Compare December 10, 2025 09:24
@sbarrio sbarrio merged commit cbd2f6f into feature/v3 Dec 10, 2025
9 checks passed
@sbarrio sbarrio deleted the sbarrio/RUM-11677/add-navigation-tracking-options branch December 10, 2025 09:42
@sbarrio sbarrio mentioned this pull request Jan 22, 2026
4 tasks
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.

3 participants