Installation
@sveltejs/kit.
Setup
1. Create the client instance
2. Add identity hook
Ensure every visitor has an identity cookie using a server hook:Request flow
Using createLoad
ThecreateLoad helper auto-extracts visitor identity and context from the SvelteKit event:
Multiple zones
Lower-level helpers
runOptionsFromEvent(event)
Extract identity and context fields manually:
ensureIdentity(event)
Sets an rlvt_tmpId cookie on the event if no identity cookie exists. Use in hooks or load functions:
Handling JSON responses
Click tracking
EveryRunResult includes redirectionUrl and trackClick(). Two patterns:
Compatibility with the client tracker
Adddata-rlvt-ssr="true" to your wrapper element. The client-side tracker automatically skips server-rendered zones.