PHPackages                             neomrc/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. neomrc/google-analytics

ActiveService[API Development](/categories/api)

neomrc/google-analytics
=======================

Google Analytics Measurement Protocol Package

0.1.1(6y ago)07MITPHPPHP &gt;=5.3.0

Since Apr 13Pushed 6y agoCompare

[ Source](https://github.com/neomrc/google-analytics)[ Packagist](https://packagist.org/packages/neomrc/google-analytics)[ RSS](/packages/neomrc-google-analytics/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Google Measurement Protocol
===========================

[](#google-measurement-protocol)

This package helps developers to make google analytics dispatches easy. Based on google's documentation:

###### To start do:

[](#to-start-do)

`composer require neomrc/google-analytics`

This is a pretty straightforward service. Here is a sample of an event hit: ```
use Neomrc\GoogleAnalytics;
...
try {
    $tracker = new GoogleAnalytics()->track('event');
    $tracker->setCategory('categoryFoo');
        ->setAction('actionBar');
        ->send();
} catch (\Exception $e) {
    // tracker sending failed
}

```

To instantiate:

> new GoogleAnalytics()-&gt;track(``);

Set Tracking ID:

> -&gt;setTrackingId(``)

Set Client ID:

> -&gt;setClientId(``)

Set User ID:

> -&gt;setUserId(``)

`This will initialize the hit type class in which you can set the values by using the methods below`

### Possible hit types

[](#possible-hit-types)

*Note: types are case-sensitive*

- `event`
- `pageview`

#### Pageview

[](#pageview)

MethodsRequiredValue Type`setDocumentHostname``false``string``setPage``false``string``setTitle``false``string`
#### Event

[](#event)

MethodsRequiredValue Type`setCategory``true``string``setAction``true``string``setLabel``false``string``setValue``false``string`To send/dispatch the analytics object

> -&gt;send(` 'value']>`)

###### This is my first package. I hope someone will find this useful.

[](#this-is-my-first-package-i-hope-someone-will-find-this-useful)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~35 days

Total

2

Last Release

2554d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a489fc6db7a7777a589c8ab750a8c21be40b4180ef732ecb4c34c97fb8b4d4e?d=identicon)[neomrc](/maintainers/neomrc)

---

Top Contributors

[![neomrc](https://avatars.githubusercontent.com/u/33591263?v=4)](https://github.com/neomrc "neomrc (7 commits)")

---

Tags

analyticsapigooglegoogle-analyticsmeasurement-protocol

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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