Skip to main content

tagOverlay

Tags a TaggableElement to be tracked as OverlayContext.

tagOverlay = (parameters: {
id: string,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue

Parameters

typedefault value
requiredidstring
optionaloptionsTagLocationOptions{ trackVisibility: { mode: 'auto' } }
optionalonErrorTrackerErrorHandlerCallbackconsole.error

Returns

TagLocationReturnValue

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.