PHPackages                             kevinfrom/ga4mp - 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. kevinfrom/ga4mp

ActiveLibrary[API Development](/categories/api)

kevinfrom/ga4mp
===============

A PHP library for interacting with Google Analytics 4 using the Measurement Protocol API.

1.0.1(1y ago)16MITPHPPHP &gt;=7.4

Since Aug 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kevinfrom/GA4MP)[ Packagist](https://packagist.org/packages/kevinfrom/ga4mp)[ RSS](/packages/kevinfrom-ga4mp/feed)WikiDiscussions main Synced 1mo ago

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

GA4MP
=====

[](#ga4mp)

A PHP library for Google Analytics 4 Measurement Protocol. Ensures type-safety and provides a fluent interface for tracking using the Measurement Protocol API.

Introduction
------------

[](#introduction)

This library is a PHP implementation of the Google Analytics 4 Measurement Protocol. It provides a fluent interface for tracking events, user properties, and user interactions. The library ensures type-safety and provides a simple way to send data to the Measurement Protocol API.

By using classes to represent events, user properties, and user interactions, the library ensures that the data sent to the API is valid and correctly formatted. This reduces the risk of errors and makes it easier to track events and user interactions.

It also makes it very easy to track events and user interactions by providing a simple and intuitive API. You can create events, user properties, and user interactions using simple classes and methods, and then send the data to the API with a single method call, and multiple events can be sent for the same user in a single request!

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

[](#installation)

You can install the library via Composer. Run the following command:

`composer require kevinfrom/ga4mp`

Example: `sign_up`
------------------

[](#example-sign_up)

This example shows how to track a `sign_up` event.

```
