PHPackages                             m2quared/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. m2quared/laravel-google-analytics

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

m2quared/laravel-google-analytics
=================================

Google Analytics for Laravel 5

v3.2.0(4y ago)735.5k2[1 PRs](https://github.com/m2quared/laravel-google-analytics/pulls)MITPHPPHP &gt;=7.4

Since Jun 28Pushed 3y ago2 watchersCompare

[ Source](https://github.com/m2quared/laravel-google-analytics)[ Packagist](https://packagist.org/packages/m2quared/laravel-google-analytics)[ RSS](/packages/m2quared-laravel-google-analytics/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

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

[](#laravel-google-analytics)

Port of Laravel 4 bundle [thujohn/analytics](https://github.com/thujohn/analytics-l4) for Laravel 5+

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

[](#installation)

Add `m2quared/laravel-google-analytics` to `composer.json`.

```
"m2quared/laravel-google-analytics": "^1.0"

```

Run `composer update` to pull down the latest release of Laravel Google Analytics.

Now open up `config/app.php` and add the service provider to your `providers` array.

```
    'providers' => [
        M2quared\Analytics\AnalyticsServiceProvider::class,
    ]
```

Now add the alias.

```
    'aliases' => [
        'Analytics' => M2quared\Analytics\AnalyticsFacade::class,
    ]
```

Configuration
-------------

[](#configuration)

Run `php artisan vendor:publish` and modify the config file `config/google-analytics.php` with your own information.

Usage
-----

[](#usage)

Querying the API for visits and pageviews in the last week.

More information about this calling the Google Analytics API can be found here

A list of all Google Analytics metrics can be found here

```
$site_id = Analytics::getSiteIdByUrl('http://github.com/'); // return something like 'ga:11111111'

$stats = Analytics::query($site_id, '7daysAgo', 'yesterday', 'ga:visits,ga:pageviews');
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~345 days

Recently: every ~156 days

Total

7

Last Release

1575d ago

Major Versions

v1.2.0 → v2.0.02020-09-23

v2.0.0 → v3.0.02020-10-16

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/340752?v=4)[Mark Beech](/maintainers/JayBizzle)[@JayBizzle](https://github.com/JayBizzle)

---

Top Contributors

[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (8 commits)")[![GC-Mark](https://avatars.githubusercontent.com/u/1477806?v=4)](https://github.com/GC-Mark "GC-Mark (6 commits)")[![MaxGiting](https://avatars.githubusercontent.com/u/9828591?v=4)](https://github.com/MaxGiting "MaxGiting (3 commits)")[![GC-Max](https://avatars.githubusercontent.com/u/10233281?v=4)](https://github.com/GC-Max "GC-Max (1 commits)")

---

Tags

google-analyticslaravellaravel-5-packagelaravel-google-analyticslaravelgooglelaravel5analytics

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

209175.5k8](/packages/bezhansalleh-filament-google-analytics)[cornford/googlitics

An easy way to integrate Google Analytics with Laravel.

3210.2k](/packages/cornford-googlitics)

PHPackages © 2026

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