flow-trace.tsx

src/hooks/flow-trace.tsx
'use client'
import { useEffect } from 'react'
import { usePathname, useSearchParams } from 'next/navigation'
import { DateTime } from 'luxon'
const DEFAULT_ENDPOINT = '/api/flow-trace'
// storage keys
const PATH_KEY = 'ft_path'
const FIRST_SEEN_KEY = 'ft_first'
const SESSION_START_KEY = 'ft_session_start'
const LAST_INTERACTION_KEY = 'ft_last_interaction'
const TIME_SPENT_KEY = 'ft_time_spent_ms'
const SESSION_SOURCE_KEY = 'ft_session_source'
const zone = 'America/Chicago'
// Luxon helpers
const nowDT = () => DateTime.now().setZone(zone)

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC