PHP code example of pirsch-analytics / laravel-pirsch

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

    

pirsch-analytics / laravel-pirsch example snippets


->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \Pirsch\Http\Middleware\TrackPageview::class,
    ]);
})

use Pirsch\Facades\Pirsch;

Pirsch::track();

use Pirsch\Facades\Pirsch;

Pirsch::track(
    name: 'Button clicked',
    meta: [
        'Label' => 'Get started',
    ],
);