1. Go to this page and download the library: Download jakeydevs/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/ */
Period::days(7) //-- Gets the last 7 days
Period::days(0) //-- Gets today
Period::create(now(), now()->subMinutes(10)) //-- Gets last 10 minutes
$period = Period::days(7);
$compare = Period::compare($period); //-- Gets the 7 days before that
$period = Period::days(0);
$compare = Period::compare($period); //-- Gets yesterdays data
Jakeydevs\Analytics\Analytics::getPageviews(Period $period): int
Jakeydevs\Analytics\Analytics::getUnique(Period $period): int
Jakeydevs\Analytics\Analytics::getBounceRate(Period $period): float
Jakeydevs\Analytics\Analytics::getDuration(Period $period): int