Skip to main content

tagNavigation

Tags a TaggableElement to be tracked as NavigationContext.

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

Parameters

typedefault value
requiredidstring
optionaloptionsTagLocationOptions
optionalonErrorTrackerErrorHandlerCallbackconsole.error

Returns

TagLocationReturnValue

Examples

import { tagNavigation } from '@objectiv/tracker-browser';
<nav {...tagNavigation({ id: 'navigation-id' })}>
...
</nav>
<TopNav {...tagNavigation({ id: 'navigation-id' })}>
...
</TopNav>

Did you know ?

tagNavigation is just syntactic sugar on top of tagLocation.