Exacaster public API
- The API key shall be provided by your Exacaster account manager.
- The logging end-point shall be provided by your Exacaster account manager.
- You can use either Javascript or PHP class to log events to Exacaster.
See php_example.php script for an example how to use the PHP class. See javascript_example.html script for an example how to use the Javascript class.
The main flow of usage is this (PHP example):
-
Initalize class with your API key: $exq = new ExacasterMetrics('API_KEY');
-
Set the logging URL $exq->setTrackingUrl('wwwtrack.exacaster.com/e.php');
-
Call the Identify event to uniquely identify the customer who is performing the event. All subsequent set calls will automatically include the customer ID.
$exq->identify('ss@ll.lt');
- Log the event called "Log in":
$exq->record('Log in', array( 'someParam' => 'data goes here'));
If you want to first set a lot of event parameters in different code places and log with one call at the end, use the "set" method:
$exq->set(array('one' => 1, 'two' => 2));
... much later in code:
$exq->record('Event Name');