PHP code example of texxasrulez / matomo_analytics

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

    

texxasrulez / matomo_analytics example snippets


// Matomo base URL (no trailing slash)
$config['matomo_analytics_url'] = 'https://analytics.example.com';

// Matomo site ID (integer)
$config['matomo_analytics_site_id'] = 1;

// Respect browser Do Not Track header
$config['matomo_analytics_respect_dnt'] = true;

// Disable tracking for authenticated Roundcube users
$config['matomo_analytics_disable_for_authenticated'] = false;

$config['plugins'][] = 'matomo_analytics';

$config['matomo_analytics_debug_enabled'] = true;          // write debug entries to Roundcube logs
$config['matomo_analytics_debug_html_comments'] = true;    // add HTML comment after injection
$config['matomo_analytics_debug_log_channel'] = 'matomo_analytics'; // optional custom log channel

$config['matomo_analytics_debug_enabled'] = true;
$config['matomo_analytics_debug_html_comments'] = true;
$config['matomo_analytics_debug_console'] = true;

  $config['matomo_analytics_cookie_domain'] = '.example.com';
  $config['matomo_analytics_domains'] = ['*.example.com'];
  

  $config['matomo_analytics_enable_heartbeat'] = true;
  

  $config['matomo_analytics_fallback_img_beacon'] = true;
  

roundcubemail/
└── plugins/
    └── matomo_analytics/
        ├── matomo_analytics.php
        ├── config.inc.php.dist
        └── composer.json
bash
cp plugins/matomo_analytics/config.inc.php.dist plugins/matomo_analytics/config.inc.php