be.ctrl.unomi
Introduction
Everything functionally related to integrating with Unomi in CiviCRM.
Installation
-
You can directly clone to your CiviCRM extension directory using
$ git clone https://github.com/kewljuice/be.ctrl.unomi.git
-
You can also download a zip file, and extract in your extension directory
$ git clone https://github.com/kewljuice/be.ctrl.unomi/archive/master.zip
-
The next step is enabling the extension which can be done from
"Administer -> System Settings -> Manage CiviCRM Extensions".
Requirements
- PHP v7.0+
- CiviCRM 5.0
Configuration
- Manage settings: yoursite.org/civicrm/unomi/settings.
- API url: public endpoint to Unomi, event collector & context fetch with session id.
- API username
- API password
Usage
Unomi Tab on Individual overview
Add a valid profile id from Unomi in the individual contact summary, under fieldset 'Unomi'
Define CiviCRM fields in Unomi
Define CiviCRM related fields in Unomi via rule, this api call passes all individual contact fields (default + custom) to Unomi.
$rule = civicrm_api3('Unomi', 'createrule');
Update individual contact
This api call updates a specific contact with fields from CiviCRM to Unomi via event.
$event = civicrm_api3('Unomi', 'createevent', [
'contact_id' => "",
]);
Create Segment (example)
{
"metadata": {
"id": "developerSegmentCondition",
"name": "developerSegmentCondition",
"description": "The user has this segment if he is a developer.",
"scope": "unomi-website",
"readOnly": true
},
"condition": {
"type": "booleanCondition",
"parameterValues": {
"operator": "and",
"subConditions": [
{
"type": "profilePropertyCondition",
"parameterValues": {
"propertyName": "properties.civicrm_job_title",
"comparisonOperator": "equals",
"propertyValue": "developer"
}
}
]
}
}
}
Known Issues
(* FIXME *)
Useful links
- https://civicrm.stackexchange.com/questions/20316/within-an-extension-how-can-load-a-custom-civi-name-spaced-class
- http://unomi.apache.org/manual/latest/index.html#_useful_apache_unomi_urls
- https://stackoverflow.com/questions/45511956/remove-a-named-volume-with-docker-compose
- https://medium.com/@otavio/giving-unomi-intelligence-a5a11053d595