nextspace
    Preparing search index...

    Function useAnalytics

    • Custom hook for automatic analytics tracking Handles:

      • Page view tracking on mount
      • Session duration tracking
      • Page visibility tracking
      • Cleanup on unmount

      Note: Heartbeat tracking is handled by Matomo's built-in enableHeartBeatTimer feature, which should be configured in your Matomo Tag Manager container.

      Parameters

      • options: UseAnalyticsOptions = {}

        The options for configuring analytics tracking, including page name and page type.

      Returns {}