tagPressable
Tags a TaggableElement to be tracked as PressableContext.
tagPressable = (parameters: {
id: string,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue
Parameters
type | default value | ||
---|---|---|---|
required | id | string | |
optional | options | TagLocationOptions | { trackClicks: true } |
optional | onError | TrackerErrorHandlerCallback | TrackerConsole.error |
Events
Unless customized via the options
parameter, automatically triggers:
Returns
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.