This package is under development right now. Any suggestions are greatly appreciated!
Install the package via composer:
composer require ismaelillodev/fathom-analytics:dev-mainPublish the config file with:
php artisan vendor:publish --tag="fathom-analytics-config"Add your FATHOM_ACCESS_TOKEN variable to your .env
use Ismaelillodev\FathomAnalytics\DTO\Aggregation;
use Ismaelillodev\FathomAnalytics\FathomAnalytics;
public function __construct(
private FathomAnalytics $fathomAnalytics
){}
public function handle()
{
$response = $this->fathomAnalytics->aggregations(
new Aggregation(
entity: 'pageview',
entity_id: 'your_site_id',
aggregates: 'uniques',
field_grouping: 'hostname,pathname'
));
//do something awesome with the response!
}If you have any questions about how to make a specific request you can visit the API documentation (https://usefathom.com/api).
Call the aggregations function and pass an Aggregation DTO.
$this->fathomAnalytics->aggregations(
new Aggregation(
entity: 'pageview',
entity_id: 'your_site_id',
aggregates: 'visits',
));Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.