tagPressable

Tags a TaggableElement to be tracked as PressableContext.

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

Parameters

typedefault value
requiredidstring
optionaloptionsTagLocationOptions{ trackClicks: true }
optionalonErrorTrackerErrorHandlerCallbackTrackerConsole.error

Events

Unless customized via the options parameter, automatically triggers:

Returns

TagLocationReturnValue

Usage example

import { tagPressable } from '@objectiv/tracker-browser';
<button {...tagPressable({ id: 'button-id' })}>Click Me!</button>
<Submit {...tagPressable({ id: 'submit' })}>Do It!</Submit>

Did you know ?

tagPressable is just syntactic sugar on top of tagLocation.