https://github.com/ceytek-labs/matomo-services-lite
Matomo Services Lite is a lightweight and extendable library designed to help you manage data easily using the Matomo in your PHP projects.
https://github.com/ceytek-labs/matomo-services-lite
automation data-updates lite-library matomo matomo-api matomo-services matomo-services-lite php track-online-visits web-analytics
Last synced: 2 months ago
JSON representation
Matomo Services Lite is a lightweight and extendable library designed to help you manage data easily using the Matomo in your PHP projects.
- Host: GitHub
- URL: https://github.com/ceytek-labs/matomo-services-lite
- Owner: ceytek-labs
- License: mit
- Created: 2024-11-06T15:29:36.000Z (7 months ago)
- Default Branch: 1.x
- Last Pushed: 2024-11-14T14:17:07.000Z (7 months ago)
- Last Synced: 2025-03-25T04:41:37.386Z (3 months ago)
- Topics: automation, data-updates, lite-library, matomo, matomo-api, matomo-services, matomo-services-lite, php, track-online-visits, web-analytics
- Language: PHP
- Homepage: https://github.com/ceytek-labs/matomo-services-lite
- Size: 893 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
------
# Matomo Services Lite - Matomo API for PHP
**Matomo Services Lite** is a lightweight and extendable library designed to help you manage data easily using the Matomo in your PHP projects.
> **Disclaimer:** This package is not an official product of Matomo. The developers accept no responsibility for any issues, discrepancies, or damages that may arise from its use.
## Requirements
- PHP 7.0 or higher (including PHP 8)
## Installation
You can add this package to your projects via Composer:
```bash
composer require ceytek-labs/matomo-services-lite
```## Services
- [Actions](#actions)
- [Get](#actions-get)
- [Get Page Urls](#actions-get-page-urls)
- [Devices Detection](#devices-detection)
- [Get Type](#devices-detection-get-type)
- [Events](#events)
- [Get Action](#events-get-action)
- [Get Category](#events-get-category)
- [Get Name](#events-get-name)
- [Get Name From Action ID](#events-get-name-from-action-id)
- [Marketing Campaigns Reporting](#marketing-campaigns-reporting)
- [Get Name](#marketing-campaigns-reporting-get-name)
- [Sites Manager](#sites-manager)
- [Get All Sites](#sites-manager-get-all-sites)
- [Users Manager](#users-manager)
- [Get Users With Site Access](#users-manager-get-users-with-site-access)
- [Visits Summary](#visits-summary)
- [Get](#visits-summary-get)## Actions
The Actions API lets you request reports for all your Visitor Actions: Page URLs, Page titles, Events, Content Tracking, File Downloads and Clicks on external websites.
### Example Usage
The following example demonstrates how to manage data in a **Actions** document:
**[⬆ Back to services](#services)**
#### Actions: Get
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->actions()
->setIdSite('')
->setPeriod('')
->setDate('')
->get();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
#### Actions: Get Page Urls
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->actions()
->setIdSite('')
->setPeriod('')
->setDate('')
->getPageUrls();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
## Devices Detection
The DevicesDetection API lets you access reports on your visitors devices, brands, models, Operating system, Browsers.
### Example Usage
The following example demonstrates how to manage data in a **Devices Detection** document:
**[⬆ Back to services](#services)**
#### Devices Detection: Get Type
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->devicesDetection()
->setIdSite('')
->setPeriod('')
->setDate('')
->getType();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
## Events
The Events API lets you request reports about your users' Custom Events.
### Example Usage
The following example demonstrates how to manage data in a **Devices Detection** document:
**[⬆ Back to services](#services)**
#### Events: Get Action
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->events()
->setIdSite('')
->setPeriod('')
->setDate('')
->getAction();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
#### Events: Get Category
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->events()
->setIdSite('')
->setPeriod('')
->setDate('')
->getCategory();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
#### Events: Get Name
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->events()
->setIdSite('')
->setPeriod('')
->setDate('')
->getName();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
#### Events: Get Name From Action ID
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->events()
->setIdSite('')
->setPeriod('')
->setDate('')
->setIdSubtable('')
->getNameFromActionId();echo '
'; print_r($result);
```
**[⬆ Back to services](#services)**## Marketing Campaigns Reporting
API for plugin MarketingCampaignsReporting
### Example Usage
The following example demonstrates how to manage data in a **Marketing Campaigns Reporting** document:
**[⬆ Back to services](#services)**
#### Marketing Campaigns Reporting: Get Name
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->marketingCampaignsReporting()
->setIdSite('')
->setPeriod('')
->setDate('')
->getName();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
## Sites Manager
The SitesManager API gives you full control on Websites in Matomo (create, update and delete), and many methods to retrieve websites based on various attributes.
### Example Usage
The following example demonstrates how to manage data in a **Sites Manager** document:
**[⬆ Back to services](#services)**
#### Sites Manager: Get All Sites
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->sitesManager()
->getAllSites();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
## Users Manager
The UsersManager API lets you Manage Users and their permissions to access specific websites.
### Example Usage
The following example demonstrates how to manage data in a **Users Manager** document:
**[⬆ Back to services](#services)**
#### Users Manager: Get Users With Site Access
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->usersManager()
->setIdSite('')
->setAccess('')
->getUsersWithSiteAccess();echo '
'; print_r($result);
```**[⬆ Back to services](#services)**
## Visits Summary
VisitsSummary API lets you access the core web analytics metrics (visits, unique visitors, count of actions (page views & downloads & clicks on outlinks), time on site, bounces and converted visits).
### Example Usage
The following example demonstrates how to manage data in a **Visits Summary** document:
**[⬆ Back to services](#services)**
#### Visits Summary: Get
```php
use CeytekLabs\MatomoServicesLite\Matomo;$result = Matomo::make()
->setApi('')
->setToken('')
->visitsSummary()
->setIdSite('')
->setPeriod('')
->setDate('')
->get();echo '
'; print_r($result);
```## Contributing
Feel free to submit a **pull request** or report an issue. Any contributions and feedback are highly appreciated!
## License
This project is licensed under the MIT License.