Collecting data with Trackers and Webhooks

  1. Home
  2. Docs
  3. Collecting data with Trackers and Webhooks
  4. Trackers – collecting data from your own applications
  5. PHP Tracker
  6. Setup



Currently the only supported method of installation is through Composer. For a tutorial on setting up a PHP project with Composer please follow this link.


Using Composer to manage your dependencies, simply add the Snowplow PHP Tracker to your project by including it in your composer.json file as a dependency.

{ "require": { "snowplow/snowplow-tracker": "0.4.0" } }
Code language: JSON / JSON with Comments (json)

Assuming you have Composer setup correctly in the root of your project. Type the following command line argument:

composer install #If composer has not been run yet composer update #If composer dependencies are already installed
Code language: PHP (php)

This will install the Snowplow Tracker and allow you to initialize a Tracker object:

// Bare minimum Tracker initialization. use Snowplow\Tracker\Tracker; use Snowplow\Tracker\Subject; use Snowplow\Tracker\Emitters\SyncEmitter; $emitter = new SyncEmitter("collector_uri"); $subject = new Subject(); $tracker = new Tracker($emitter, $subject);
Code language: PHP (php)

If you’d like to learn more about Snowplow BDP you can book a demo with our team, or if you’d prefer, you can try Snowplow technology for yourself quickly and easily.