iOS 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 ViewController. Manually tagging pages can help improve the specificity of metrics in LogRocket. This tagged page will be combined with the last started ViewController to form a URL of the form https://{Bundle ID}/{ViewController 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 insideviewDidAppear
or later in the ViewController’s lifecycle.
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 with
addingpercentencoding
using character set urlPathAllowed.