PHP code example of brew-bytes / acorn-analytics

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

    

brew-bytes / acorn-analytics example snippets


$this->dispatch('analytics:event', name: 'contact_form_submitted', form: 'sales');

'auto-tracking' => [
    'enabled' => true,
    'phone-clicks' => true,
    'email-clicks' => true,
    'file-downloads' => true,
    'download-extensions' => ['pdf', 'doc', 'docx', 'zip', /* ... */],
    'scroll-depth' => true,
    'scroll-depth-thresholds' => [25, 50, 75, 100],
    'outbound-links' => false,
],

'consent' => [
    'kie-consent:granted',  // emitted by your consent UI
],

  'google-analytics' => ['id' => 'G-XXXXXXX'],