Server events
Symfony
Send server-side conversions from Symfony — forwarded from the request, credited to the real visitor.
Fire a server-side conversion from a Symfony controller, forwarding the visitor's request:
<?phpnamespace App\Controller;use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Attribute\Route;use Symfony\Contracts\HttpClient\HttpClientInterface;class ConversionController{ #[Route('/checkout/success', name: 'checkout_success')] public function __invoke(Request $request, HttpClientInterface $client): Response { $forwarded = $request->headers->get('X-Forwarded-For'); $ip = $forwarded ? trim(explode(',', $forwarded)[0]) : $request->getClientIp(); $client->request('POST', 'https://datalook.app/event', [ 'auth_bearer' => 'YOUR_API_KEY', 'json' => [ 'event_name' => 'success', 'name' => 'signup', 'page_path' => $request->getPathInfo(), 'ip' => $ip, 'user_agent' => $request->headers->get('User-Agent'), ], ]); return new Response('', Response::HTTP_NO_CONTENT); }}Note
Symfony's request->getClientIp() only honors X-Forwarded-For when trusted proxies are configured, so the example reads the header's first entry directly and falls back to the accessor.
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.