You can install the package via composer:
composer require combindma/sendinblue-tracker
You can publish the config file with:
php artisan vendor:publish --provider="Combindma\SendinBlueTracker\SendinBlueTrackerServiceProvider" --tag="sendinblue-tracker-config"
This is the contents of the published config file:
return [
'tracker_id' => env('SENDINBLUE_TRACKER_ID', null),
/*
* The key under which data is saved to the session with flash.
*/
'sessionKey' => env('SENDINBLUE_TRACKER_SESSION_KEY', strtolower(config('app.name')).'_sendinbluetracker'),
/*
* Enable or disable script rendering. Useful for local development.
*/
'enabled' => env('ENABLE_SENDINBLUE_TRACKER', false),
];
This is the js implementation. There is also RESTFUL implementation
First you'll need to include Sendinblue Tracker's script.
<!DOCTYPE html>
<html>
<head>
@include('sendinbluetracker::head')
</head>
<body>
@include('sendinbluetracker::body')
/*
* Content
*/
</body>
The is the primary way to create a new user within sendinblue or update an exsisting one. The primary way of indentifying users is via their email address.
SendinBlueTracker::identify('[email protected]');
The next method is how we fire an event within sendinblue, this can be used to trigger workflows and other types of automation.
SendinBlueTracker::event(
'eventName',
// Event Data
[
'CTA_URL' => 'https://www.example.com',
'COST' => '20.00'
],
// User Data
[
'EMAIL' => '[email protected]',
'FIRSTNAME' => 'XXXXX'
]
);
The package can also set data to render on the next request. This is useful for setting data after an internal redirect.
SendinBlueTracker::flash(
'event name',
// Event Data (optional)
[
'CTA_URL' => 'https://www.example.com',
'COST' => '20.00'
],
// User Data (optional)
[
'EMAIL' => '[email protected]',
'FIRSTNAME' => 'XXXXX'
]
);
For this implementation you don't need to include Sendinblue Tracker's script
SendinBlueTracker::identifyPost('[email protected]',[
'FIRSTNAME' => 'first name',
'LASTNAME' => 'last name'
]);
SendinBlueTracker::eventPost('[email protected]', 'event name',
// Event Data (optional)
[
'CTA_URL' => 'https://www.example.com',
'COST' => '20.00'
],
// User Data (optional)
[
'EMAIL' => '[email protected]',
'FIRSTNAME' => 'XXXXX'
],
);
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.