Skip to content

Queue

To prevent the tracking API calls to the SimpleStats server blocking your app requests and to ensure fault tolerance and retries, we strongly recommend using Laravel's built-in queue service.

INFO

Starting from version 2.0.13, the SimpleStats client attempts to use Laravel's defer helper (supported since Laravel 11) to handle API calls to our server. This reduces the necessity of using a queue, as API calls no longer block your requests. However, for fault tolerance, retries, or high traffic, we still recommend using the queue.

WARNING

Should you still prefer to not use the queue, you can skip this section and head over to the next page of our documentation. But be aware if something went wrong during API communication, you may lose important tracking data information!

Configuration

Here you can define to which queue the tracking API calls should be dispatched:

php
//config/simplestats-client.php

    'queue' => env('SIMPLESTATS_QUEUE', 'default'),

Job Monitoring

It's important to know if your queue is running and if the API calls are getting dispatched successfully. For that, if you want something light-weight, we highly recommend spaties laravel-failed-job-monitor package, which can notify you via mail or Slack when a queued job fails. If you want something more robust, you may use Horizon, Laravel's incredible powerful native queue monitoring service!

Fault Tolerance and Retries

Despite our best efforts to maintain continuous availability, the complex nature of API communications means that interruptions can occur for various reasons, ranging from network issues on your end to temporary outages of our service. To mitigate these challenges, we've designed the Job that communicates with our API to be resilient, automatically retrying failed API calls multiple times with specified intervals between attempts. This strategy helps safeguard against data loss during unexpected disruptions in communication.

In the event you suspect data was not captured due to prolonged service interruptions, our Data Import feature provides a straightforward way to synchronize the missing information with our system, ensuring your analytics remain complete and accurate.