tagContent
Tags a TaggableElement to be tracked as ContentContext.
tagContent = (parameters: {
id: string,
options?: TagLocationOptions,
onError?: TrackerErrorHandlerCallback
}) => TagLocationReturnValue
Parameters
type | default value | ||
---|---|---|---|
required | id | string | |
optional | options | TagLocationOptions | |
optional | onError | TrackerErrorHandlerCallback | TrackerConsole.error |
Returns
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.