Server events
Qwik
Send server-side conversions from a Qwik routeAction$ — forwarded from the request, credited to the real visitor.
Fire a server conversion from a Qwik City routeAction$:
import { routeAction$ } from '@builder.io/qwik-city'export const useTrackSignup = routeAction$(async (_data, requestEvent) => { const { url, request, clientConn } = requestEvent const ip = (request.headers.get('x-forwarded-for') || '').split(',')[0].trim() || clientConn.ip || '' const userAgent = request.headers.get('user-agent') || '' await fetch('https://datalook.app/event', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ event_name: 'success', name: 'signup', page_path: url.pathname, ip, user_agent: userAgent }) }) return { ok: true }})Note
In Qwik City the URL path is requestEvent.url.pathname (a URL object); clientConn.ip is the framework's client-IP accessor and may be undefined on some adapters, so X-Forwarded-For is checked first.
How it’s credited
This reads the visitor’s IP and User-Agent from the request and forwards them, so the conversion lands on the real visitor — device, country, and source included. No
identify(), no ids, no cookie. Get an API key in the dashboard under Track it from your server; see the overview for the concepts and the webhook path.