tagRootLocation
Tags a BrowserSDK:TaggableElement to be tracked as RootLocationContext.
tagRootLocation = (parameters: {
id: string,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue
Make sure to never use tagRootLocation while RootLocationContextFromURLPlugin is active. It will lead to multiple RootLocationContexts, which is forbidden.
For applications relying on URLs, RootLocationContext can be automatically instrumented via the RootLocationContextFromURLPlugin
.
This is enabled by default in AngularTracker, inherited from BrowserTracker.
Reconfiguring or removing RootLocationContextFromURLPlugin
If you need RootLocationContextFromURLPlugin to track a different url slug, search parameter or the hashtag, you can reconfigure it to do so.
When reconfiguring the RootLocationContextFromURLPlugin is not a viable option, the Plugin should be removed before using this Location Tagger to instrument roots manually.
- Check out this guide for some examples.
This attribute directive builds on top of BrowserSDK:tagRootLocation
Parameters
type | default value | ||
---|---|---|---|
required | id | string | |
optional | options | BrowserSDK:TagLocationOptions | |
optional | onError | BrowserSDK:TrackerErrorHandlerCallback | TrackerConsole.error |
Returns
BrowserSDK:TagLocationReturnValue
Examples
<main [tagRootLocation]="{ id: 'page' }">
...
</main>