Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.
/ plausible-php Public archive

The library provides access to the Plausible API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves from API responses.

License

Notifications You must be signed in to change notification settings

devarts/plausible-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

183 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plausible PHP

Build Status Latest Stable Version PHP Version Require License

The library provides access to the Plausible API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves from API responses.

Install

Via Composer

$ composer require devarts/plausible-php

Usage

Simple usage looks like:

use Devarts\PlausiblePHP\Configuration;
use Devarts\PlausiblePHP\PlausibleApi;
use Devarts\PlausiblePHP\Support\Metric;
use Devarts\PlausiblePHP\Support\Filter;

$plausible = new PlausibleApi(Configuration::create('plausible_api_token'));

$metrics = Metric::create()
    ->addBounceRate()
    ->addVisitors();

$filters = Filter::create()
    ->addVisitBrowser('Chrome', Filter::NOT_EQUAL);

$result = $plausible->stats()->getAggregate('example.com', [
    'metrics' => $metrics,
    'filters' => $filters,
]);

echo $result->bounce_rate->value;

Credits

License

The MIT License (MIT). Please see License File for more information.

About

The library provides access to the Plausible API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves from API responses.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 14

Languages