tagLocation

Tags a BrowserSDK:TaggableElement to be tracked as any LocationContext.

tagLocation = (parameters: {
instance: LocationContext,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue
caution

tagLocation is a lower-level API. Unless really needed, it's easier to use specific Location Taggers APIs.

info

This attribute directive builds on top of BrowserSDK:tagLocation

Parameters

typedefault value
requiredinstanceBrowserSDK:LocationContext
optionaloptionsBrowserSDK:TagLocationOptionsDynamically calculated based on instance. See the Events table below.
optionalonErrorBrowserSDK:TrackerErrorHandlerCallbackTrackerConsole.error

Returns

BrowserSDK:TagLocationReturnValue

Events

Unless customized via the options parameter, the given instance determines which Events are triggered automatically:

LocationContextAutomatically triggers
ContentContext
ExpandableContextBrowserSDK:trackPressEvent
InputContextBrowserSDK:trackInputChangeEvent
LinkContextBrowserSDK:trackPressEvent
MediaPlayerContext
NavigationContext
OverlayContextBrowserSDK:trackVisibleEvent, BrowserSDK:trackHiddenEvent
PressableContextBrowserSDK:trackPressEvent

Usage example

<section [tagLocation]="{ instance: makeContentContext({ id: 'layout' }) }">
<div [tagLocation]="{ instance: makeOverlayContext({ id: 'modal' }) }">
...
</div>
</section>
Did you notice ?

In the example above we factored the instance parameters by using BrowserSDK:Location Context Core Factories.