PHPackages                             moriony/ga-measurement-protocol-client - 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. moriony/ga-measurement-protocol-client

ActiveLibrary

moriony/ga-measurement-protocol-client
======================================

Google Analytics Measurement Protocol PHP Client wrapper

0.0.1(11y ago)010MITPHP

Since Sep 4Pushed 11y ago2 watchersCompare

[ Source](https://github.com/moriony/ga-measurement-protocol-client)[ Packagist](https://packagist.org/packages/moriony/ga-measurement-protocol-client)[ RSS](/packages/moriony-ga-measurement-protocol-client/feed)WikiDiscussions master Synced 1mo ago

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

Google Analytics Measurement Protocol PHP Client wrapper
========================================================

[](#google-analytics-measurement-protocol-php-client-wrapper)

[![Build Status](https://camo.githubusercontent.com/047e8e50dfe8839db5412564cb62397ad395ba29f4ec0f07b5541ec4ee31f2c7/68747470733a2f2f7472617669732d63692e6f72672f6d6f72696f6e792f67612d6d6561737572656d656e742d70726f746f636f6c2d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/moriony/ga-measurement-protocol-client)[![Coverage Status](https://camo.githubusercontent.com/43bec7ad2b9f797a4ebb1a8432423835ada6faaf9219606a3f5f4311ee3a5bdf/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d6f72696f6e792f67612d6d6561737572656d656e742d70726f746f636f6c2d636c69656e742f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/moriony/ga-measurement-protocol-client?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/e83a2565d357affa22d2963cd4256219f5330bf275d0b41b83d14c542cd0ddef/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32376365393433632d663130342d343934372d626266612d6236653766306433643066312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/27ce943c-f104-4947-bbfa-b6e7f0d3d0f1)[![Latest Stable Version](https://camo.githubusercontent.com/adeb1fad3c2ad505507c079668c2434528a6e93e54853307b12ef8eccb4355ed/68747470733a2f2f706f7365722e707567782e6f72672f6d6f72696f6e792f67612d6d6561737572656d656e742d70726f746f636f6c2d636c69656e742f762f737461626c652e737667)](https://packagist.org/packages/moriony/ga-measurement-protocol-client)[![Total Downloads](https://camo.githubusercontent.com/4fa5bd1fb64e85364eef1ffc82ccb4d183e623367b3acf59fc0465f4d10a5f2a/68747470733a2f2f706f7365722e707567782e6f72672f6d6f72696f6e792f67612d6d6561737572656d656e742d70726f746f636f6c2d636c69656e742f646f776e6c6f6164732e737667)](https://packagist.org/packages/moriony/ga-measurement-protocol-client) [![Latest Unstable Version](https://camo.githubusercontent.com/49d98966d799333fceddf07291b13ff698e5078a9ae27c2288e2ed488d3dee71/68747470733a2f2f706f7365722e707567782e6f72672f6d6f72696f6e792f67612d6d6561737572656d656e742d70726f746f636f6c2d636c69656e742f762f756e737461626c652e737667)](https://packagist.org/packages/moriony/ga-measurement-protocol-client)[![License](https://camo.githubusercontent.com/9ca5c2f379a1ca92e1cf01b207ad777ee438c1573a04157ba5788fd342223086/68747470733a2f2f706f7365722e707567782e6f72672f6d6f72696f6e792f67612d6d6561737572656d656e742d70726f746f636f6c2d636c69656e742f6c6963656e73652e737667)](https://packagist.org/packages/moriony/ga-measurement-protocol-client)

Google Analytics Measurement Protocol PHP client wrapper based on [krizon/php-ga-measurement-protocol](https://github.com/krizon/php-ga-measurement-protocol)

See [Google Analytics Measurement Protocol documentation](https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide)

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

[](#installation)

Use [Composer](http://getcomposer.org/doc/00-intro.md) to add this library to your dependencies:

```
$ php composer.phar require moriony/ga-measurement-protocol-client:dev-master
```

Usage
-----

[](#usage)

```
use \Moriony\Google\Analytics\MeasurementProtocol\Client;

$client = new Client([
    Client::OPT_TRACKING_ID => 'UA-XXXXXXXXX-Y',
    Client::OPT_SSL => true,
]);

$response = $client->createEvent()
    ->setCustomerId(555)
    ->setCategory('video')
    ->setAction('play')
    ->setLabel('holiday')
    ->setValue(300)
    ->track();
```

Testing
-------

[](#testing)

Before you can run the tests make sure you installed the dependencies using composer:

`$ composer install`

PHPUnit itself is included in the dependencies so now you can call:

`$ vendor/bin/phpunit`

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

4268d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd9a799b87d152a1af81ff3093367b5d91771d6b9703ac9399730f1b14ebbedf?d=identicon)[moriony](/maintainers/moriony)

---

Top Contributors

[![moriony](https://avatars.githubusercontent.com/u/1702031?v=4)](https://github.com/moriony "moriony (51 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moriony-ga-measurement-protocol-client/health.svg)

```
[![Health](https://phpackages.com/badges/moriony-ga-measurement-protocol-client/health.svg)](https://phpackages.com/packages/moriony-ga-measurement-protocol-client)
```

###  Alternatives

[coincheck/coincheck

Bindings of coincheck API

202.2k](/packages/coincheck-coincheck)

PHPackages © 2026

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