hostinger / amplitude-php
此包已被弃用且不再维护。没有建议的替代包。
关于此包最新版本(1.0.0)没有可用的许可信息。
1.0.0
2016-06-13 15:20 UTC
Requires
- ext-curl: *
- ext-json: *
- guzzlehttp/guzzle: ^6.2
This package is not auto-updated.
Last update: 2023-11-03 14:59:58 UTC
README
安装
composer require hostinger/amplitude-php
如何使用
require_once 'vendor/autoload.php'; $apiKey = '123'; $amplitudeClient = new Amplitude\AmplitudeClient($apiKey); $amplitudeEvent = new Amplitude\Message\Event(); // For user properties $amplitudeEvent ->set('eventType', 'test.event') ->set('userId', 1) ->set('deviceId', 1) ->set('city_id', 1) ->set('country_id', 1); // For event properties $amplitudeEvent ->addToEventProperties('revenue', 1); try { $response = $amplitudeClient->track($amplitudeEvent); print 'event tracked'; } catch (Exception $e) { print $e->getMessage(); }