openinbound / openinbound-api
API for the OpenInbound analytics server
dev-master
2017-05-19 10:12 UTC
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2026-03-16 17:21:10 UTC
README
Usage
$oi = new OI('YOUR_TRACKING_ID', 'YOUR_API_KEY');
Note: You'll find your tracking id and API on the settings page on app.openinbound.com.
Examples
Update an existing contact
$data['email'] = 'email'
$data['first_name'] = 'Joe';
$data['last_name'] = 'Long';
$data['company_name'] = 'Company LCC';
$data['phone'] = '041 450 10 66';
$oi = new OI('YOUR_TRACKING_ID', 'YOUR_API_KEY');
$oi->updateContact($_COOKIE['_oi_contact_id'], $data);
Log a custom event to the OpenInbound backend
$data['title'] = 'This title will be sent in the OpenInbound event list';
$data['event_type'] = 'raw';
$data['raw'] = 'Whatever data you want to send.';
$oi = new OI('YOUR_TRACKING_ID', 'YOUR_API_KEY');
$oi->addEvent($_COOKIE['_oi_contact_id'], $data);
Note: The $_COOKIE['_oi_contact_id'] will be automatically set by the OpenInbound tracking script.
Get in touch
If you need further assistance, please contact lf@netnode.ch
# API Reference ###Contact Entity
Properties
| Contacts email address | |
| first_name | First name of contact |
| last_name | Last name of contact |
| company_name | Company name of contact |
| phone | Phone number of contact |
Event Entity
Properties
| contact_id | Contact id |
| event_type | Event type (pageview, lifecycle_stage_changed, submission, raw) |
| title | The "title" of the event. |
| raw | Any data you want to save. |