1. Go to this page and download the library: Download divoto/cairn library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
divoto / cairn example snippets
use Divoto\Cairn\Facades\Cairn;
Cairn::event('signed_up', ['plan' => 'pro']);
Cairn::conversion('purchase', 49.99);
Cairn::ignore('admin/*'); // for the rest of this request
use Divoto\Cairn\Concerns\HasAnalytics;
class Article extends Model
{
use HasAnalytics;
}
$article->trackView();
$article->trackEvent('shared', ['network' => 'mastodon']);