Capture Custom Pages

Android 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. Manually tagging pages can help improve the specificity of metrics in LogRocket. This tagged page will be combined with the running Activity to form a URL of the form https://{Package Name}/{Acitivty Class Name}/{Relative Page Tag}. These URLs can be referenced in Path Analysis, Heatmaps, and URL filters in the LogRocket dashboard.

SDK.tagPage("Apparel")

SDK.tagPage("Apparel/Sweaters")

SDK.tagPage("Apparel/Pants")

🚧

Make sure to only tag pages when the page is visible on screen, as opposed to when it is created. For example, tagPage() would be called inside setMenuVisibility instead of onCreateView.

📘

We recommend tagging pages hierarchically as you would define website URL paths.

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 with ‘/’ remaining unencoded.