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
type | default value | ||
---|---|---|---|
required | instance | BrowserSDK:LocationContext | |
optional | options | BrowserSDK:TagLocationOptions | Dynamically calculated based on instance . See the Events table below. |
optional | onError | BrowserSDK:TrackerErrorHandlerCallback | TrackerConsole.error |
Returns
BrowserSDK:TagLocationReturnValue
Events
Unless customized via the options
parameter, the given instance
determines which Events are triggered automatically:
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.