PHPackages                             nicdev/ga-reporter - 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. nicdev/ga-reporter

ActiveLibrary[API Development](/categories/api)

nicdev/ga-reporter
==================

A PHP client for the Google Analytics API

03PHP

Since Jul 8Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/nicdev/ga-reporter)[ Packagist](https://packagist.org/packages/nicdev/ga-reporter)[ RSS](/packages/nicdev-ga-reporter/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Google Analytics PHP Client
===========================

[](#google-analytics-php-client)

A modern PHP client for the Google Analytics API

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

[](#installation)

```
composer require nicdev/ga-reporter
```

Setup
-----

[](#setup)

1. Create a Google Cloud Project
2. Enable the Google Analytics API
3. Create credentials (OAuth 2.0 or Service Account)
4. Download your credentials JSON file

Usage
-----

[](#usage)

```
// Initialize with credentials
$client = new \Nicdev\GoogleAnalytics\Client([
    'credentials_path' => '/path/to/credentials.json'
]);

// Create Reporter instance
$reporter = new \Nicdev\GoogleAnalytics\Reporter($client);

// Get page views for last 30 days
$startDate = new DateTime('30 days ago');
$endDate = new DateTime();
$pageViews = $reporter->getPageViews('VIEW_ID', $startDate, $endDate);

// Get real-time users
$activeUsers = $reporter->getRealTimeUsers('VIEW_ID');
```

Features
--------

[](#features)

- Universal Analytics (UA) and GA4 support
- Real-time reporting
- Audience metrics
- Event tracking
- Custom dimensions and metrics
- Automatic token refresh
- PSR-4 compliant

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/144079?v=4)[Nic Rosental](/maintainers/nicdev)[@nicdev](https://github.com/nicdev)

---

Top Contributors

[![nicdev](https://avatars.githubusercontent.com/u/144079?v=4)](https://github.com/nicdev "nicdev (21 commits)")

### Embed Badge

![Health badge](/badges/nicdev-ga-reporter/health.svg)

```
[![Health](https://phpackages.com/badges/nicdev-ga-reporter/health.svg)](https://phpackages.com/packages/nicdev-ga-reporter)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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