PHPackages                             immera/analytics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. immera/analytics

ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

immera/analytics
================

Immera Laravel Analytics

0.1.1(3y ago)03.8kMITPHPPHP ^8.1|^8.2

Since Apr 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/immera/analytics-laravel)[ Packagist](https://packagist.org/packages/immera/analytics)[ Docs](https://github.com/immera/analytics)[ RSS](/packages/immera-analytics/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Interface to access Analytics API
=================================

[](#interface-to-access-analytics-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/311fc10189bee94c92a163d01f144e896b1036506eb0f6545afd9cd181bdd9ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d6d6572612f616e616c79746963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/immera/analytics)[![Total Downloads](https://camo.githubusercontent.com/bef44ade1f224e1cbe83f8d05fad7cf830c660026a68e8846bfb4dc9420c7225/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d6d6572612f616e616c79746963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/immera/analytics)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require immera/analytics
```

After installing please setup your API key in the `.env` file

```
ANALYTICS_SERIAL_KEY=
```

Usage
-----

[](#usage)

#### Store data

[](#store-data)

```
Analytics::store([
    'action' => 'test',
    'project' => 'analytics',
    'price' => rand(0, 10000) / 100,
    'quantity' => rand(0, 8),
])
```

#### Fetch data

[](#fetch-data)

```
$result = Analytics::query()
    ->match(['action' => 'test'])
    ->project(['action' => 1, 'project' => 1])
    ->limit(1)
    ->fetchJson();
```

#### Count actions by hour

[](#count-actions-by-hour)

```
$result = Analytics::query()
    ->match([
        'action' => 'test',
        'created_at.year' => 2022,
    ])
    ->group([
        '_id' => [
            'year' => '$created_at.year',
            'month' => '$created_at.month',
            'day' => '$created_at.day',
            'hour' => '$created_at.hour',
        ],
        'count' => [
            '$sum' => 1,
        ],
    ])
    ->sort([
        '_id.year' => -1,
        '_id.month' => -1,
        '_id.day' => -1,
        '_id.hour' => -1,
    ])
    ->limit(100)
    ->fetchJson();
```

#### Get Total price and average quantity by month, order desc

[](#get-total-price-and-average-quantity-by-month-order-desc)

```
$result = Analytics::query()
    ->match([
        'action' => 'test',
    ])
    ->group([
        '_id' => [
            'year' => '$created_at.year',
            'month' => '$created_at.month',
        ],
        'totalPrice' => [
            '$sum' => '$price',
        ],
        'averageQuantity' => [
            '$avg' => '$quantity',
        ],
    ])
    ->sort([
        '_id.year' => -1,
        '_id.month' => -1,
    ])
    ->limit(100)
    ->fetchJson();
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Immera](https://github.com/immera)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~80 days

Total

5

Last Release

1168d ago

PHP version history (3 changes)0.0.1PHP ^7.4|^8.0

0.1.0PHP ^7.4|^8.0|^8.1

0.1.1PHP ^8.1|^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1838187?v=4)[António Almeida](/maintainers/promatik)[@promatik](https://github.com/promatik)

---

Top Contributors

[![promatik](https://avatars.githubusercontent.com/u/1838187?v=4)](https://github.com/promatik "promatik (11 commits)")[![vishaltarkar](https://avatars.githubusercontent.com/u/17743115?v=4)](https://github.com/vishaltarkar "vishaltarkar (2 commits)")

---

Tags

analyticsimmera

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/immera-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/immera-analytics/health.svg)](https://phpackages.com/packages/immera-analytics)
```

###  Alternatives

[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[cornford/googlitics

An easy way to integrate Google Analytics with Laravel.

3310.2k](/packages/cornford-googlitics)[panakour/analytics

Get whatever data you want from google analytics.

267.6k](/packages/panakour-analytics)[ohseesoftware/laravel-server-analytics

Server side analytics for your Laravel application or website.

1421.2k1](/packages/ohseesoftware-laravel-server-analytics)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
