PHPackages                             tijmenwierenga/snowplow-tracker - 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. tijmenwierenga/snowplow-tracker

ActiveLibrary

tijmenwierenga/snowplow-tracker
===============================

Snowplow tracker for PHP powered applications

v0.2.0(4y ago)32[1 PRs](https://github.com/TijmenWierenga/snowplow-tracker/pulls)MITPHPPHP ^8.1

Since Nov 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/TijmenWierenga/snowplow-tracker)[ Packagist](https://packagist.org/packages/tijmenwierenga/snowplow-tracker)[ RSS](/packages/tijmenwierenga-snowplow-tracker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (14)Versions (4)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/d7df321f626426dd4b0e5b4ff3785dd2be988f9c00fd6e25b09ae0bf7e2fbdf3/687474703a2f2f706f7365722e707567782e6f72672f74696a6d656e77696572656e67612f736e6f77706c6f772d747261636b65722f76)](https://packagist.org/packages/tijmenwierenga/snowplow-tracker) [![Total Downloads](https://camo.githubusercontent.com/779f8a9b69c7314bf05d7b47d3b3d45110e6ee3522f6d10fab4e5e38aa32e6e8/687474703a2f2f706f7365722e707567782e6f72672f74696a6d656e77696572656e67612f736e6f77706c6f772d747261636b65722f646f776e6c6f616473)](https://packagist.org/packages/tijmenwierenga/snowplow-tracker) [![Latest Unstable Version](https://camo.githubusercontent.com/33ec05cf5876f05b4a4563609a068292225b86fa037c669375f5d39a14387db7/687474703a2f2f706f7365722e707567782e6f72672f74696a6d656e77696572656e67612f736e6f77706c6f772d747261636b65722f762f756e737461626c65)](https://packagist.org/packages/tijmenwierenga/snowplow-tracker) [![License](https://camo.githubusercontent.com/97df342b9b28faa3816f8447dc4997eff1d3335bdf3aabd62cd34ad5c088784b/687474703a2f2f706f7365722e707567782e6f72672f74696a6d656e77696572656e67612f736e6f77706c6f772d747261636b65722f6c6963656e7365)](https://packagist.org/packages/tijmenwierenga/snowplow-tracker) [![PHP Version Require](https://camo.githubusercontent.com/c1563025a29a68a467253f3341965a388cba593ecea598525d37fc5aa0cf5dc6/687474703a2f2f706f7365722e707567782e6f72672f74696a6d656e77696572656e67612f736e6f77706c6f772d747261636b65722f726571756972652f706870)](https://packagist.org/packages/tijmenwierenga/snowplow-tracker)

Snowplow Tracker
================

[](#snowplow-tracker)

An alternative to the original Snowplow Tracker.

This Tracker provides:

- an object-oriented API for event tracking
- extension points in order to integrate your own domain logic
- abstractions to swap dependencies

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

[](#installation)

With [composer](https://getcomposer.org/):

```
composer require tijmenwierenga/snowplow-tracker
```

Setup
-----

[](#setup)

The Snowplow Tracker is instantiable by providing an emitter and optionally additional configuration. Currently, only a single emitter is available: the `HttpClientEmitter`.

### HttpClientEmitter

[](#httpclientemitter)

The `HttpClientEmitter` sends the payload to a collector over HTTP. If you want to use this emitter a [PSR-7](https://www.php-fig.org/psr/psr-7/), [PSR-17](https://www.php-fig.org/psr/psr-17/) and [PSR-18](https://www.php-fig.org/psr/psr-18/) compliant implementation needs to be installed.

Popular PSR-18 compliant HTTP Clients are:

- [symfony/http-client](https://symfony.com/doc/current/http_client.html)
- [guzzlehttp/guzzle](https://docs.guzzlephp.org/en/stable/)

Popular PSR-7 compliant libraries are:

- [guzzlehttp/psr7](https://github.com/guzzle/psr7)
- [nyholm/psr7](https://github.com/Nyholm/psr7)

By default, the `php-http/discovery` will discover the installed HTTP Client and Request Factory so no additional configuration is required. If you wish to configure your HTTP client yourself you can pass in your own. Same goes for the Request Factory.

With auto-discovery:

```
