Auto-capture

When the provider initialises, Nohmo registers global listeners and tracks the following events with no extra code required.

EventTriggerData fields
PAGE_VIEWEvery route changepage, referrer, sessionId
TIME_SPENTWhen navigating away from a pageseconds (time on previous page)
SCROLL_DEPTHAt 25%, 50%, 75%, 100% scroll milestonesdepth (number)
CLICKAny click on an interactive elementtag, text, href, x, y
RAGE_CLICKThree or more clicks in quick successiontag, text, x, y

Note: All auto-captured events include deviceId, sessionId, and ts (ISO timestamp). You can disable any category via the options prop.

Manual page view hook

For routers Nohmo doesn't recognise automatically, use the hook:

tsx
import { usePageView } from 'nohmo'
export default function MyPage() {
usePageView('/my-page') // sends PAGE_VIEW once on mount
return <div></div>
}