PHP code example of fyrndly / laravel-matomo-tracker
1. Go to this page and download the library: Download fyrndly/laravel-matomo-tracker 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/ */
fyrndly / laravel-matomo-tracker example snippets
use FyrnDly\Matomo\Facades\Matomo;
// Track a Page View
Matomo::pageView('Home Page');
// Track a Goal
Matomo::goal(1, 50.0);
// Track Site Search
Matomo::search('search keyword', 'category', 10);
use Livewire\Component;
use FyrnDly\Matomo\Traits\MatomoTrackView;
class Dashboard extends Component
{
use MatomoTrackView;
public $pageTitle = 'Main Dashboard'; // Automatically tracked as "Go to page Main Dashboard"
}