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(7y ago)07MITPHPPHP &gt;=5.3.0

Since Apr 13Pushed 7y 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 3w 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 18% 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

2601d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33591263?v=4)[Marc Pioquinto](/maintainers/neomrc)[@neomrc](https://github.com/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

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M966](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

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