tagRootLocation

Tags a BrowserSDK:TaggableElement to be tracked as RootLocationContext.

tagRootLocation = (parameters: {
id: string,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue
Low level api

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.

info

This attribute directive builds on top of BrowserSDK:tagRootLocation

Parameters

typedefault value
requiredidstring
optionaloptionsBrowserSDK:TagLocationOptions
optionalonErrorBrowserSDK:TrackerErrorHandlerCallbackTrackerConsole.error

Returns

BrowserSDK:TagLocationReturnValue

Examples

<main [tagRootLocation]="{ id: 'page' }">
...
</main>