### Install Filament Matomo via Composer Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/README.md Install the Filament Matomo plugin via Composer. This package depends on jeffersongoncalves/laravel-matomo, which will be installed automatically. ```bash composer require jeffersongoncalves/filament-matomo ``` -------------------------------- ### Publish and Run Matomo Settings Migration Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/README.md Publish and run the settings migration from the laravel-matomo package. Required before using the plugin's settings page. ```bash php artisan vendor:publish --tag=matomo-settings-migrations php artisan migrate ``` -------------------------------- ### Register render hook for tracking script Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/resources/boost/skills/filament-matomo-development/SKILL.md Inject the Matomo tracking script into the head of all panels using the HEAD_END render hook. ```php FilamentView::registerRenderHook( PanelsRenderHook::HEAD_END, fn (): View => view('matomo::script') ); ``` -------------------------------- ### Tracking section form fields Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/resources/boost/skills/filament-matomo-development/SKILL.md Define the tracking configuration fields: domains, site ID, and host analytics URL. ```php // Section: Tracking configuration TextInput::make('domains') // Domain(s) to track TextInput::make('site_id') // Matomo Site ID TextInput::make('host_analytics') // Matomo server URL (without protocol) ``` -------------------------------- ### Publish Filament Matomo Translations Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/README.md Publish the plugin's translation files to customize them. The plugin includes translations for English and Brazilian Portuguese (pt_BR). ```bash php artisan vendor:publish --tag=filament-matomo-translations ``` -------------------------------- ### Register MatomoPlugin in Filament PanelProvider Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/README.md Register the MatomoPlugin in your Filament PanelProvider. Once registered, the plugin injects the Matomo tracking script into the of your Filament panels and adds a Settings Page for tracking configuration. ```php use JeffersonGoncalves\Filament\Matomo\MatomoPlugin; public function panel(Panel $panel): Panel { return $panel // ... ->plugins([ MatomoPlugin::make(), ]); } ``` -------------------------------- ### Advanced section form fields Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/resources/boost/skills/filament-matomo-development/SKILL.md Define the advanced settings fields: file and script, with defaults matomo.php and matomo.js. ```php // Section: Advanced settings TextInput::make('file') // PHP tracking endpoint (default: matomo.php) TextInput::make('script') // JS tracking file (default: matomo.js) ``` -------------------------------- ### Disable Matomo Settings Page Source: https://github.com/jeffersongoncalves/filament-matomo/blob/3.x/README.md Disable the settings page if you only want the tracking script injection without the settings page. ```php MatomoPlugin::make() ->settingsPage(false), ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.