The following figure shows a simple implementation of the Interact API. A visitor logs into a web site and navigates to a page which displays offers. The visitor selects an offer and logs out. While the interaction is simple, there are several events which occur both in the touchpoint and the runtime server.
In this example, the startSession method does four things. First, it creates a new runtime session. Second, it sends a request to load the customer profile data into the session. Third, it sends a request to use the profile data and start an interactive flowchart to place the customer into segments. This flowchart run is asynchronous. Fourth, the runtime loads any offer suppression and global and individual offer treatment information into the session. The session data is held in memory for the duration of the session.
The executeBatch method enables you to call more than one method in a single call to the runtime server. This particular executeBatch calls two other methods,
getOffers and
postEvent. The
getOffers method requests a list of offers. The runtime uses the segmentation data, the offer suppression list, the treatment rules, and the learning module to propose a set of offers. The runtime returns a set of offers which are displayed on the content page.
The postEvent method triggers one of the events defined in the design environment. In this particular case, the event sends a request to log the offers presented to contact history.
The button associated with selecting the offer is configured to send another postEvent method. This event sends a request to log the offer acceptance to response history.
The endSession method closes the session. If the visitor forgets to log out, there is a configurable session timeout to ensure that all sessions eventually end. If you want to keep any of the data passed to the session, such as information included in parameters in the
startSession or
setAudience methods, work with the person who creates interactive flowcharts. The person who creates an interactive flowchart can use the Snapshot process to write that data to a database before the session ends and that data is lost. You can then use the
postEvent method to call the interactive flowchart containing the Snapshot process.