tagContent

Tags a TaggableElement to be tracked as ContentContext.

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

Parameters

typedefault value
requiredidstring
optionaloptionsTagLocationOptions
optionalonErrorTrackerErrorHandlerCallbackTrackerConsole.error

Returns

TagLocationReturnValue

Usage example

import { tagContent } from '@objectiv/tracker-browser';
<Layout {...tagContent({ id: 'layout' })}>
<div {...tagContent({ id: 'section' })}>
...
</div>
</Layout>

Did you know ?

tagContent is just syntactic sugar on top of tagLocation.