Simple Laravel provider for Openpanel event tracking.
You can install the package via composer:
composer require bleckert/openpanel-laravel
Grab your Openpanel ID and secret by navigating to Settings -> Projects and create a client using typ "Other". You'll then recieve an ID and secret.
Add the following to your .env
file:
OPENPANEL_CLIENT_ID=your-id
OPENPANEL_CLIENT_SECRET=your-secret
If you self-host Openpanel, you can set the OPENPANEL_URL
variable to your Openpanel URL.
OPENPANEL_URL=https://your-openpanel-url.com
use Bleckert\OpenpanelLaravel\Openpanel;
$openpanel = app(Openpanel::class);
// Identify user
$openpanel->setProfileId(1);
// Update user profile
$openpanel->setProfile(
id: 1,
firstName: 'John Doe',
// ...
);
// Track event
$openpanel->event(
name: 'User registered',
);
By default, Openpanel requests are sent synchronously. If you want to send the requests in the background, you can set OPENPANEL_QUEUE_CONNECTION
in your env file.
OPENPANEL_QUEUE_CONNECTION=redis
Optionally, you can set the queue name:
OPENPANEL_QUEUE_NAME=your-queue-name
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.