Most mobile apps rely on a Laravel backend, yet backend events are often the weakest part of the analytics picture. A signup that fails in a queued job, a flag that reads differently on the server than in the app, or a request that never reaches the client: none of these show up in app-side tracking. Without server context, your funnels have silent holes.
On 6 November 2026, PostHog released a dedicated Laravel package. It adds runtime context for requests, queues, commands and exceptions, offers opt-in capture for auth changes, jobs, models and selected domain events, and reads feature flags through Laravel Pennant.
Data Points to Track
- request_route: named route that handled the call
- auth_event: login, logout or password reset
- job_name: queued job that ran
- job_status: processed, failed or retried
- job_duration_ms: time spent in the job
- command_name: Artisan command executed
- exception_class: type of server error
- flag_key: flag read through Pennant
- flag_value: variant the server returned
- distinct_id_source: authenticated user, session or anonymous
- app_platform: ios, android or web caller
- app_version: client release making the request
Setup Steps
- List the backend moments that matter. Pick signup, purchase and sync jobs before you switch anything on.
- Install the package with Composer and add your project key to the environment file.
- Enable only the capture you need. The package is opt-in, so start with auth changes and failed jobs.
- Set the user identity. Use the same distinct ID as your mobile SDK so server and app events join up.
- Send app context. Pass platform and app version from request headers into event properties.
- Read flags through Pennant so the server and the app agree on each variant.
- Test in staging. Trigger a failed job and a login, then confirm both appear with the right user.
Actionable Insights
Compare job failure rates with app-side drop-off. If purchases fall in the app and failed payment jobs rise on the server at the same time, you have found the cause without guessing.
Check flag agreement. When the server and client return different variants for one user, experiment results are unreliable until it is fixed.
Watch exceptions by app version. A cluster tied to one release points to an API change that older clients cannot handle.
Privacy and Cost Notes
Opt-in capture means you choose what leaves your server. Avoid sending model attributes that hold personal data, and review event volume after a week, since jobs and requests can generate many events.
A Simple Rollout Plan
Start in staging with one route and one job. Release to a small share of traffic, compare error counts with your existing logs for a week, then widen the capture. Tell analysts which events are new, so a jump in event volume is not mistaken for growth.
Common Mistakes to Avoid
Do not capture every model event by default, because the volume is high and rarely useful. Do not use a different user ID on the server than in the app. And do not forget queue workers: they run outside the request cycle, so they need the same configuration as your web process.
Related Resources
- Product analytics for joining server and app events
- Documentation for the usage and ingest API
- Services for help with end-to-end tracking