Server events
Laravel
Send server-side conversions from Laravel — forwarded from the request, credited to the real visitor.
Fire a server-side conversion from a Laravel route, crediting the real visitor:
use Illuminate\Http\Request;use Illuminate\Support\Facades\Http;Route::post('/checkout/success', function (Request $request) { // First X-Forwarded-For entry is the end user; else Laravel's client IP. $forwarded = $request->header('X-Forwarded-For'); $ip = $forwarded ? trim(explode(',', $forwarded)[0]) : $request->ip(); Http::withToken('YOUR_API_KEY') ->acceptJson() ->post('https://datalook.app/event', [ 'event_name' => 'success', 'name' => 'signup', 'page_path' => '/' . $request->path(), // path() omits the leading slash 'ip' => $ip, 'user_agent' => $request->userAgent(), // forwarded verbatim ]); return response()->noContent();});Note
Laravel's request->path() returns the path without a leading slash (and "/" for the root), so prepend "/" to match the visitor's real 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.