/be.ctrl.unomi

Everything functionally related to integrating with Unomi in CiviCRM

Primary LanguagePHPOtherNOASSERTION

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.

Screenshot

  • 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'

Screenshot

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