tagOverlay
Tags a TaggableElement to be tracked as OverlayContext.
tagOverlay = (parameters: {
id: string,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue
Parameters
type | default value | ||
---|---|---|---|
required | id | string | |
optional | options | TagLocationOptions | { trackVisibility: { mode: 'auto' } } |
optional | onError | TrackerErrorHandlerCallback | TrackerConsole.error |
Returns
Events
Unless customized via the options
parameter, automatically triggers:
Examples
import { tagOverlay } from '@objectiv/tracker-browser';
<div {...tagOverlay({ id: 'modal-id' })}>
...
</div>
<Modal {...tagOverlay({ id: 'modal-id' })}>
...
</Modal>
Did you know ?
tagOverlay
is just syntactic sugar on top of tagLocation.