UNPKG

@dotcms/analytics

Version:

Official JavaScript library for Content Analytics with DotCMS.

23 lines (21 loc) 706 B
import { DotAnalytics } from '../../dotAnalytics/shared/dot-content-analytics.model'; /** * Custom hook that handles analytics page view tracking. * * @example * ```tsx * function Button({ title, urlTitle }) { * const { track } = useContentAnalytics(); * * // First parameter: custom event name to identify the action * // Second parameter: object with properties you want to track * return ( * <button onClick={() => track('btn-click', { title, urlTitle })}> * See Details → * </button> * ); * } * ``` * @returns {DotContentAnalyticsCustomHook} - The analytics instance used to track page views */ export declare const useContentAnalytics: () => DotAnalytics;