minube/amplitude-php

Amplitude SDK for PHP - Use Amplitude in your PHP project

2.0 2018-11-13 11:29 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:14:38 UTC


README

How to use it

$apiKey = 123456;
$amplitudeClient = new \Amplitude\AmplitudeClient($apiKey);

$amplitudeEvent = new \Amplitude\AmplitudeEvent();

// For user properties
$amplitudeEvent->set('city_id', 123)
    ->set('country_id', 34);
    
// For event properties
$amplitudeEvent->addToEventProperties('revenue', 12.34);

$response = $amplitudeClient->track($amplitudeEvent);