Capture Custom Pages

React Native Manual Page Tagging

LogRocket automatically captures mobile pages (defined as ViewController for iOS and Activity for Android) and tracks this under the Visited URL attribute. These URLs are then referenced in Path Analysis, Heatmaps, and URL filters in the LogRocket dashboard. This API allows you to tag sub pages, for more granular filtering and metrics.

tagPage() can be used to tag a sub page of the currently running Activity or ViewController. Manually tagging pages can help improve the specificity of metrics in LogRocket. This tagged page will be combined with the running Activity or ViewController to form a URL of the form https://{Bundle ID or Package Name}/{Acitivity or ViewController Class Name}/{Relative Page Tag}. These URLs can be referenced in Path Analysis, Heatmaps, and URL filters in the LogRocket dashboard.

LogRocket.tagPage("Apparel")

LogRocket.tagPage('Apparel/Sweaters")

LogRocket.tagPage("Apparel/Pants")

Restrictions and Recommendations

  • The maximum supported relativePage tag length is 500 characters. A warning will be generated if the provided relativePage exceeds this length.
  • Page tags are url encoded according to Uri.encode on Android and with allowed characters urlPathAllowed on iOS. β€˜/’ will remain unencoded.
  • For accurate page tracking, make sure to only tag pages when the page is visible on screen, as opposed to when it is created.
  • We recommend tagging pages hierarchically as you would define website URL paths.