PHP Library
Our PHP Library has the basic functionality laid out in our API specifications. It allows you to record events and set properties. However, you might miss these features from our JavaScript library:
- No built-in mechanisms for generating and saving identities for your users
- No built-in mechanisms for automatically tying together anonymous and named identities.
- No built-in mechanisms for running A/B tests
- No automatic triggering of Events (such as detecting Search Engine traffic)
For these reasons we recommend our JavaScript Library to our users, and to use the PHP Library for recording events that occur server-side (account Upgrades may be an example of one such event). You might also consider looking at other APIs our customers have created.
Setup
You can download a copy of the API from:
https://github.com/kissmetrics/kissmetrics-php
You will need your API key which you can find in your site settings.
Usage
Before calling any of the common methods, you must initialize with a valid API key: