This guide covers how to synchronize Kentico Contact Groups with SensorPro using scheduled tasks. Kentico user groups allows you to divide your site visitors and users into groups of people with shared characteristics, which you can then accurately target in your on-line marketing efforts.This segmentation is achieved easily using macro conditions. Macro condition-based contact groups automatically gather all contacts that fulfill certain criteria defined through the condition into a group.

After the synchronization process has run, you can view the Kentico contacts in SensorPro. The mapped data will be passed forward to the SensorPro contact record and the contacts will be tagged with the Kentico contact group name. This means that contact groups can be targeted using SensorPro segmentation.

For example take the following 3 groups in Kentico: Finance, Marketing, Technical as shown below.

See the example configuration of Marketing group using macro conditions.

After the synchronization task has run these contacts will be visible in the Contact Universe each contact will be tagged with all the groups which they are part of in Kentico.

SensorPro is setup as a Kentico module

To setup follow these steps:

  1. Download SensorPro module from https://github.com/SensorPro/Kentico
  2. Open the Sites application in Kentico
  3. Click Import site or objects. The import wizard starts.
  4. Upload the package by clicking Upload package selecting:
  1. Select Preselect all items. Click next
  2. Select import settings as shown below and Click next. Click Finish. SensorPro module should now be installed
  1. Note 1: If you get a warning that says "Import has finished with minor problems. See warning message below", you can ignore that message.
  2. Note 2: When you click the finish button, you may have to wait up to a minute before it finishes and returns to the Sites application.

Integration to SensorPro is achieved by rest api calls. We configure these API calls using the SensorPro Email & Surveys Module.

  1. Select Configuration | SensorPro Email & Surveys from the sidebar (if not listed, refresh the page).
  2. Add new SensorPro Configuration
  1. Organization ID: This is your SensorPro Organization
  2. Api Action: Select "ExportContactGroups"
  3. Active: Enable to activate
  4. API URL: Leave as default
  1. API User ID: The SensorPro user which will be used to call the API. This user must be a specific api user.
  2. API Password: The password for the api user
  3. API Key: The API key is gotten from your SensorPro organization. Menu Admin | Edit Organization | Advanced Options Tab
  4. API Body: This contains the mapping between Kentico contacts and SensorPro Contacts. Data is merged using merge tags. To merge any Kentico contact data just wrap the field name in {}, for example {ContactEmail} will merge the contact detail. Shown below is a simple mapping, first name, last name, email address and the group name. More information on how to configure the API body can be found https://sensorpro.net/api UpdateAdd method.
{
  "AddToList": [
    "{contactgroupname}"
  ],
  "Contact": [
    {
      "FirstName": "{ContactFirstName}",
      "LastName": "{ContactLastName}",
      "PersonalEMail": "{ContactEmail}"
    }
  ],
  "Options": {
    "Parameters": {},
    "Action": ""
  },
  "ReturnFailedRequests": false,
  "UpdateByKey": "email",
  "SendWelcomeEmail": false,
  "SignupFormId": "00000000-0000-0000-0000-000000000000"
}
  1. Write to application log: Write status message to Application log
  2. Only synchronize since last run: Only update records which changed since last task execution.
  3. Run Asynchronous: This improves the performance of the api calls in that the contact add/updates are queued and processed asynchronously in SensorPro.

Setup the scheduled task, follow these steps:

  1. Select scheduled tasks application
  1. Edit the task called "SensorPro Sync Contact Groups" enter the information as follows:
  1. Task display name: Set as required
  2. Task name: Leave as is
  3. Task provider: SensorPro
  4. Assembly name: NT.Interface.Kentico.CMSScheduleContactGroups

  1. Set the schedule as required
  1. Task data: Contains the SensorPro organization which this task should push contact data to. Replace "YOUR_ORGANIZATION" with your SensorPro organization

  1. Run task in separate thread, Use external service: These should be checked.

  1. When the scheduled task completes it will post a status message showing the results of the synchronization. The contacts will now be added and updated to SensorPro.