PHP code example of rocramer / nova-matomo-analytics

1. Go to this page and download the library: Download rocramer/nova-matomo-analytics 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/ */

    

rocramer / nova-matomo-analytics example snippets


protected function cards()
{
    return [
        new \Rocramer\MatomoAnalytics\Cards\UniqueVisitors(),
        new \Rocramer\MatomoAnalytics\Cards\Visits(),
        new \Rocramer\MatomoAnalytics\Cards\VisitLength(),
        new \Rocramer\MatomoAnalytics\Cards\BounceRate(),
        new \Rocramer\MatomoAnalytics\Cards\Outlinks(),
        new \Rocramer\MatomoAnalytics\Cards\Downloads(),
        new \Rocramer\MatomoAnalytics\Cards\EntryPages(),
        new \Rocramer\MatomoAnalytics\Cards\ExitPages(),
        new \Rocramer\MatomoAnalytics\Cards\MostViewedPages(),
    ];
}

'matomo' => [
    'token'   => env('MATOMO_TOKEN'),
    'url'     => env('MATOMO_URL'),
    'page_id' => env('MATOMO_PAGE_ID')
]

'matomo' => [
    'token'   => env('MATOMO_TOKEN'),
    'url'     => env('MATOMO_URL'),
    'page_id' => env('MATOMO_PAGE_ID'),
    'caching' => 3
]