PHPackages                             akki-io/laravel-google-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. [API Development](/categories/api)
4. /
5. akki-io/laravel-google-analytics

ActiveLibrary[API Development](/categories/api)

akki-io/laravel-google-analytics
================================

A Laravel package to retrieve data from Google Analytics 4 using the GA4 Query Explorer

v12(9mo ago)49129.1k↓30.8%22MITPHPPHP ^8.0CI failing

Since Feb 13Pushed 9mo ago4 watchersCompare

[ Source](https://github.com/akki-io/laravel-google-analytics)[ Packagist](https://packagist.org/packages/akki-io/laravel-google-analytics)[ Docs](https://github.com/akki-io/laravel-google-analytics)[ RSS](/packages/akki-io-laravel-google-analytics/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (12)Used By (0)

 [![Hero](https://raw.githubusercontent.com/akki-io/laravel-google-analytics/master/images/hero.png)](https://raw.githubusercontent.com/akki-io/laravel-google-analytics/master/images/hero.png)

Laravel Google Analytics
========================

[](#laravel-google-analytics)

[![Latest Version](https://camo.githubusercontent.com/d19f54d2d2333f04319519940db68a11f9c86a230a6aea50f9adcb91b13bae2d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f616b6b692d696f2f6c61726176656c2d676f6f676c652d616e616c79746963732e7376673f7374796c653d666c61742d737175617265)](https://github.com/akki-io/laravel-google-analytics/releases)[![GitHub Workflow Status (branch)](https://camo.githubusercontent.com/2bc65299dc67b4cd52271e5c5461b8c821a616a04ab6925e6b3a91ebd1ad6158/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b6b692d696f2f6c61726176656c2d676f6f676c652d616e616c79746963732f746573742e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/2bc65299dc67b4cd52271e5c5461b8c821a616a04ab6925e6b3a91ebd1ad6158/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b6b692d696f2f6c61726176656c2d676f6f676c652d616e616c79746963732f746573742e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)[![StyleCI](https://camo.githubusercontent.com/deb89f3497b47ab48b863c6fd6d24abd31bd6ed0c255c24c24ac57e865c2f4f0/68747470733a2f2f7374796c6563692e696f2f7265706f732f3434313733353134322f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/441735142)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/5eb9965d32f0bf067327c905cf3a59c58672f93ae9d95dd5abce66d459284760/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b6b692d696f2f6c61726176656c2d676f6f676c652d616e616c79746963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akki-io/laravel-google-analytics)

A Laravel package to retrieve data from Google Analytics 4 using the GA4 Query Explorer

TL;DR
-----

[](#tldr)

Using this package you can easily retrieve data from Google Analytics 4.

Below are some examples.

```
use AkkiIo\LaravelGoogleAnalytics\Facades\LaravelGoogleAnalytics;
use AkkiIo\LaravelGoogleAnalytics\Period;
use Google\Analytics\Data\V1beta\Filter\StringFilter\MatchType;
use Google\Analytics\Data\V1beta\MetricAggregation;
use Google\Analytics\Data\V1beta\Filter\NumericFilter\Operation;

// get the top 20 most viewed pages for last 30 days
LaravelGoogleAnalytics::getMostViewsByPage(Period::days(30), $count = 20);

// get the top 20 dates with most users for last 12 months
LaravelGoogleAnalytics::getMostUsersByDate(Period::months(12), $count = 20);

// build a query using the `get()` method
LaravelGoogleAnalytics::dateRanges(Period::days(30), Period::days(60))
    ->metrics('active1DayUsers', 'active7DayUsers')
    ->dimensions('browser', 'language')
    ->metricAggregations(MetricAggregation::TOTAL, MetricAggregation::MINIMUM)
    ->whereDimension('browser', MatchType::CONTAINS, 'firefox')
    ->whereMetric('active7DayUsers', Operation::GREATER_THAN, 50)
    ->orderByDimensionDesc('language')
    ->get();
```

Please refer to the [wiki](https://github.com/akki-io/laravel-google-analytics/wiki) for more details.

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)

- [Akki Khare](https://github.com/akki-io)
- [All Contributors](../../contributors)
- [spatie/laravel-analytics](https://github.com/spatie/laravel-analytics)

License
-------

[](#license)

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

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance57

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 75.4% 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 ~146 days

Recently: every ~237 days

Total

10

Last Release

284d ago

PHP version history (2 changes)v1.0PHP ^7.4|^8.0

v1.6PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e14e68b3ae58f56193332356b226c47e11512dc4520ab60918a9aa1958eff252?d=identicon)[akki-io](/maintainers/akki-io)

---

Top Contributors

[![akki-io](https://avatars.githubusercontent.com/u/34255218?v=4)](https://github.com/akki-io "akki-io (49 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (6 commits)")[![MaxGiting](https://avatars.githubusercontent.com/u/9828591?v=4)](https://github.com/MaxGiting "MaxGiting (2 commits)")[![nsinisterra](https://avatars.githubusercontent.com/u/17008744?v=4)](https://github.com/nsinisterra "nsinisterra (2 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (2 commits)")[![zpwparsons](https://avatars.githubusercontent.com/u/102785627?v=4)](https://github.com/zpwparsons "zpwparsons (1 commits)")[![GC-Mark](https://avatars.githubusercontent.com/u/1477806?v=4)](https://github.com/GC-Mark "GC-Mark (1 commits)")[![GeorgeFourkas](https://avatars.githubusercontent.com/u/66795055?v=4)](https://github.com/GeorgeFourkas "GeorgeFourkas (1 commits)")[![marispro](https://avatars.githubusercontent.com/u/5610414?v=4)](https://github.com/marispro "marispro (1 commits)")

---

Tags

google-analyticsgoogle-analytics-4google-analytics-query-explorerlaravelphplaravel google analyticsakki-io

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/akki-io-laravel-google-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/akki-io-laravel-google-analytics/health.svg)](https://phpackages.com/packages/akki-io-laravel-google-analytics)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[rapidez/core

Rapidez Core

1823.5k72](/packages/rapidez-core)

PHPackages © 2026

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