Server events
SolidStart
Send server-side conversions from a SolidStart API route — forwarded from the request, credited to the real visitor.
Send a conversion from a SolidStart API route handler:
import type { APIEvent } from '@solidjs/start/server'export async function POST({ request }: APIEvent) { // First entry of X-Forwarded-For is the real visitor; fall back to remote addr. const xff = request.headers.get('x-forwarded-for') ?? '' const ip = xff.split(',')[0].trim() 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: new URL(request.url).pathname, ip, user_agent: request.headers.get('user-agent') ?? '' }) }) return new Response(null, { status: 204 })}Note
SolidStart API handlers receive an APIEvent whose request is a standard Web Request, so read the path from new URL(request.url).pathname and headers via request.headers.get(); there is no request.path.
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.