Real Time Triggers Setup Guide

Apteco integrates with Kafka to allow Real Time Triggers. This guide outlines how to setup and configure Pull Marketing and Streams.

Note: For the following example, TealHols system is used to demonstrate how Pull Marketing and Streams can be used to run PeopleStage campaigns when new registrations or logins are used for the Teal Green Reviews website.

Create Pull Marketing Database

Using the FastStats Configurator → Database Management, use the Advanced option to connect to your SQL server and create a Pull Marketing database.

Note: Recommended naming convention is PM_<system name>.

Pull Marketing: Configure FastStats Service

In the FastStats Configurator → FastStats Services → Properties → TealHols → Pull Marketing, add the connection string for the Pull Marketing database.

Click Save and restart the FastStats service for this change to be picked up.

Pull Marketing: Configure Web Service

In the FastStats Configurator → Web Service → TealHols → Database, add the connection string for the Pull Marketing database.

Click Save and close.

Note: If the FastStats launcher is open, it needs to be restarted to pick up this change.

Create Streams Database

Using the FastStats Configurator > Database Management, use the Advanced option to connect to your SQL server and create a Streams database.

Note: Recommended naming convention is SD_<system name>.

Streams: Configure FastStats Service

In the FastStats Configurator → FastStats Services → Properties → TealHols → Streams, add the connection string for the Streams database.

Click Save and restart the FastStats service for this change to be picked up.

Streams: Configure Web Service

In the FastStats Configurator → Web Service → TealHols → Database, add the connection string for the Streams database.

Click Save and close.

Note: If FastStats launcher is open, then it needs to be restarted to pick up this change.

Pull Marketing: Configure in FastStats

Grant your Group / User the role of Pull Marketing Administrator and Streams Administrator. You need to log out and back in again for this change to get picked up.

In FastStats go to File → Tools → Administrative Functions → Modify Pull Marketing Settings → Modify Providers, click Add New Pull Marketing Provider.

Give it the name Apteco and select the Provider Apteco.

Note: For this demo we’re using https://www.tealgreenholidays.co.uk/pmm.

Click Okay and close.

Next, go to File → Tools → Administrative Functions → Modify Pull Marketing Settings → Modify Pull Marketing Stores, click Add New Pull Marketing Marketing Store.

Enter the Pull Marketing Store Name, choose the Provider from the drop down and in the settings enter the following, changing the dataStoreName to match what you are using and the endPoint (if not using Apteco Pull Marketing API):

Copy
{
"dataStoreName":"TealGreen",
"endPoint":"https://www.tealgreenholidays.co.uk/pmm"
}

Check the box for PeopleStage Data Definition, and name the Folder that you would like this to appear in. Choose the table that the records are at, such as People:

Add the Pull Marking Fields that you require.

You should include urn and use the Type of Reference and then select the Person URN variable:

For this example, we’re sending the following other fields for use in Pull Marketing:

Pull Marketing Field Name Type Variable
urn Reference Person URN
email Variable Email Address
firstname Variable Forename
lastname Variable Surname
event String Event
offer String Offer

Below demonstrates what these settings are from / doing:

Once all fields have been added, click Okay and close.

Populate the Data Store

There are many ways that a client might populate their Data Store, but one of the options is to use PeopleStage, with a campaign that uses a Pull Marketing Channel.

In PeopleStage open the Channel Editor, and create a New Pull Marketing Channel.

Give the Channel a name, for this example, it’s Teal Green Pull Marketing. Next, go to the Output Settings and use the Add Field button to add each of the fields that were entered into FastStats.

Note: Match the casing that was used in FastStats.

For additional variables, add the variables that you’re using from FastStats.

Create a campaign with the audience of the People and Fields that you wish to populate in the Data Store. For this example, we’re populating the Data Store with three People from the FastStats system with the channel’s additional variables of Person URN, Email Address, Forename and Surname, and we’re using the campaigns Content step to populate the Event and Offer that they receive (these are virtual variables in my system, but could just be text from the content).

The delivery uses the Pull Marketing channel so that there are no parts to populate. Once this campaign has been completed the Data Store now has these records stored in it.

Note: Check the records are loaded correctly with Swagger.

Stream: Configure in FastStats

For the Apteco example integration for Kafka, we have used Confluent. Partners may choose a different technology to use Kafka.

The TealGreenReviews website has been created to update Kafka when users login or register as new members. The pages below detail how this is done.

In the example below a known user logs in to TealGreenReviews and the setup triggers an email campaign.

In FastStats go to File → Tools → Administrative Functions → Modify Stream Settings → Modify Providers, click Add New Stream Provider.

Give the Stream a Name and from the Providers select Kafka.

In the Settings the following format is needed (for the BootstrapServers, SaslUsername and SaslPassword):

"BootstrapServers":"pkc-*****.******.azure.confluent.cloud:9092",

"SaslMechanism":"Plain",

"SaslUsername":"6I5***********",

"SaslPassword":"*****************************",

"SecurityProtocol":"SaslSsl"

}

Click OK and close.

Next, go to File → Tools → Administrative Functions → Modify Stream Settings → Modify Streams, click Add New Stream

Enter the Stream Name:

Select the Provider.

In Settings, add the Topic that this Stream is using in Confluent.

Note: Format is {”Topic”:”Name”}.

Check the PeopleStage Data Definition.

Chose the folder that the fields appear in PeopleStage (this creates the folder so that you don’t need to know of existing folders).

Now add the Stream Fields that you’re getting from your Kafka source, and match the Field to the system variables where possible, choosing string for those that can’t be matched. For the example, the urn matches as a Reference to the Person URN variable, whereas the location does not match to a variable so is just a String.

For this example, we’re setting up the following fields for use in Streams:

Streams Field Name Type Variable/Name
urn Reference Person URN
email Variable Email Address
location String Location

Click OK and close.

Create PeopleStage Campaign

Note: When creating a Real Time Triggers campaign, it is important to only have an Audience and a Message. If anything else, such as a pool, is added then the campaign can not run as a Real Time Trigger campaign.

In PeopleStage the Streams Audience is now available in the folder created by the setup process.

For the schedule use Event Triggered so that when a user logins to the website, the event runs immediately.

In the Content step, use the Fields defined in the Stream in the Values → Streams → TealGreen\SignIn folder that was created in the setup process.

Next, add the Fields from the Pull Marketing Store that adds additional information about the known individual that is being targeted by this campaign (as they logged in to TealGreenReviews). Remember to rename the Content Field names to be what your Channel is expecting. For example, my Adestra channel is expecting ‘forename’ rather than ‘firstname’.

Note: If your Pull Marketing and Streams have the same fields such as email, then use the Streams Field as it is quicker than Pull Marketing.

Choose whichever channel you’re using for this campaign, it could be an email or a push notification or any other suitable channel.

Note: Do not add a Pool. A Real Time Triggered Campaign is only ever an Audience and Message with Content and Delivery, nothing else.

Publish the Campaign.

Running Real Time Triggers

When a user logins into the website, then the website produces the event which Kafka/Confluent monitor, PeopleStage then consumes this by triggering a campaign and getting the additional data from the Pull Marketing Store.

Here is an example Video of a User logging in, Confluent receiving the data, and with the Pull Marketing Store, sending all the necessary data to an ESP (email service provider):

The ESP then sends the email to the individual who logged in with additional information, in this case a discount code based on their lifetime spend.

Adding Communications

To ensure that Real Time Triggers run quickly, the communications are not added at the time of running but are instead held in files within the System\Stash directory. These communications are then added by the service using a schedule.

To configure the schedule for the Communications upload, in PeopleStage go to File > Administration > Diagram Settings Editor > Realtime Data.

Set the schedule that works best for your system, remembering that this is just adding the Communications data to the Communications Table. If you don’t use constraints then once a day should be enough.