PHP code example of localzet / personal-analytics

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

    

localzet / personal-analytics example snippets


use Localzet\PersonalAnalytics\Analytics;
use Localzet\PersonalAnalytics\Config;

$analytics = new Analytics($pdo, new Config(
    projectToken: $_ENV['ANALYTICS_TOKEN'],
    allowedHost: 'app.example.com',
    allowedOrigins: ['https://app.example.com'],
));