ricbra / php-kissmetrics-api
Guzzle based implementation of KISSmetrics REST API
Installs: 1 115
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~5.0
- guzzlehttp/guzzle-services: ~0.4.0
Requires (Dev)
- phpunit/phpunit: ~4
This package is not auto-updated.
Last update: 2024-11-19 04:07:08 UTC
README
This library is a PHP 5.4 implementation of the KISSmetrics API
This client is build using Guzzle 4.0.
License
This library is released under the MIT license. See the complete license in the LICENSE file.
Installation
Start by installing composer. Next do:
$ composer require ricbra/php-kissmetrics-api
Requirements
PHP >=5.4.0
Usage
Creating a new instance:
<?php $client = \KISSmetrics\ClientFactory::factory('your-api-key-here', [ 'defaults' => [ 'headers' => ['User-Agent' => 'your-app-name/1.0.0 +https://yourapp.com'] ] ]);
Set user properties
<?php $client->setProperties([ '_p' => 'Facebook #23', '_d' => 1, '_t' => 21421421, 'Property' => 'Value' ]);
Record event
<?php $client->recordEvent([ '_p' => 'Facebook #23', '_n' => 'Test event', '_t' => 12421412, '_d' => 1, 'Property' => 'Value', ]);
Alias user
<?php $client->recordEvent([ '_p' => 'Facebook #23', '_n' => 'Test event', '_t' => 12421412, '_d' => 1, 'Property' => 'Value', ]);