PHP code example of danielgnh / footprint

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

    

danielgnh / footprint example snippets


use Danielgnh\Footprint\Models\Footprint;
use Danielgnh\Footprint\Models\Visit;

$page = Footprint::onPage('https://example.com/pricing')
    ->between(now()->subDays(30), now())
    ->onDevice('mobile');

$views = $page->clone()->ofType('view')->count();
$medianTime = $page->clone()->dwellPerView()->get()->whereNull('section')->median('ms');
$readToTheEnd = $page->clone()->deepestScroll()->get()->where('depth', 100)->count() / max(1, $views);
$deadClicks = $page->clone()->ofType('dead')->inSection('hero')->selectRaw('target, count(*) as clicks')->groupBy('target')->get();

$gaveUp = Visit::whereHas('footprints', fn ($footprints) => $footprints->onPage('/quote')->ofType('abandon')->where('target', 'email'));
$events = $visit->footprints()->timeline()->get();
bash
composer migrate