PHP documentation outdated
Opened this issue · 5 comments
I might be missing something, but the PHP API documentation points to the kissmetrics/kissmetrics-php repo. However, the API described in the documentation doesn't appear to resemble the API in the code at all. For example there is no KM
class, nor even a km.php
file.
Is it possible to have the PHP API doc updates to reflect the current API?
@eskfung The link on our support page points to our new PHP library, but still documents the old PHP interface. I'm thinking we could update the main PHP docs page to use our new PHP library, but have a link to an archived version of the docs that shows the old specs. Thoughts?
@percyhanna 👍, gotta get familiar with the new PHP interface. Will try to get this finished by the end of the week.
@DataTables thank you for the feedback! I am reusing the examples included in the kissmetrics-php README, so please let us know if that is not sufficient.
I have two suggestions to improve the documentation shown there if I may:
- Include instructions on how to include the library files. Its a simple
require
statement in PHP, but at the moment you need to include the files individually and in a particular order. I've just sent a pull request which makes is a single one line include, but I would still recommend including that in the documentation -require( 'KISSMetrics/KM.php' );
if you accept my pull request. - The line
>alias('old-anonymous-cookie')
appears to be meaningless. The string value given has no particular value - what we need is the anonymous cookie value. I've used the following for that (although I'm not 100% certain that this is the correct way to do it):
if ( isset( $_COOKIE['km_ai'] ) ) {
$km->alias( $_COOKIE['km_ai'] );
}
The server-side libraries are presumably used primarily for triggering events on the sever-side only so hopefully this will make it a little bit easier for people new to KISSMetrics such as myself to get going with it if they are using PHP.
@DataTables thanks for the suggestions, I think those seem quite reasonable. @eskfung could you take a look at updating the examples as well?