getOffersForMultipleInteractionPoints

The getOffersForMultipleInteractionPoints method enables you to request offers from the runtime server for multiple IPs with deduplication.

function callGetOffersForMultipleInteractionPoints(commandsToExecute, callback) {

        var ssId = document.getElementById('gop_sessionId').value;
        var requestDetailsStr = document.getElementById('requestDetail').value;
        
        //trim string
        var trimmed = requestDetailsStr.replace(/\{/g, "");
        var parts = trimmed.split("}");

        //sanitize strings
        for(i = 0; i < parts.length; i += 1) {
            parts[i] = parts[i].replace(/^\s+|\s+$/g, "");
        }

        //build get offer requests
        var getOffReqs = [];
        for(var i = 0; i < parts.length; i += 1) {
            var getofReqObj = parseGetOfferReq(parts[i]);
            if (getofReqObj) {
                getOffReqs.push(getofReqObj);

        InteractAPI.getOffersForMultipleInteractionPoints
        (ssId, getOffReqs, callback);

}
  • session ID - a string identifying the current session.

  • requestDetailsStr - a string providing an array of GetOfferRequest objects.

    Each GetOfferRequest object specifies:

    • ipName - The interaction point (IP) name for which the object is requesting offers
    • numberRequested - The number of unique offers it needs for the specified IP
    • offerAttributes - Requirements on the attributes of the delivered offers using an instance of OfferAttributeRequirements
    • duplicationPolicy - Duplication policy ID for the offers that will be delivered

      Duplication policies determine whether duplicated offers will be returned across different interaction points in a single method call. (Within an individual interaction point, duplicated offers are never returned.) Currently, two duplication policies are supported.

      • NO_DUPLICATION (ID value = 1). None of the offers that have been included in the preceding GetOfferRequest instances will be included in this GetOfferRequest instance (that is, Unica Interact will apply de-duplication).
      • ALLOW_DUPLICATION (ID value = 2). Any of the offers satisfying the requirements specified in this GetOfferRequest instance will be included. The offers that have been included in the preceding GetOfferRequest instances will not be reconciled.
    • callback - If the method was successful, the callback function calls onSuccess. If the method failed, the callback function calls onError.

    The order of requests in the array parameter is also the priority order when offers are being delivered.

    For example, suppose the IPs in the request are IP1, then IP2, that no duplicated offers are allowed (a duplication policy ID = 1), and each is requesting two offers. If Unica Interact finds offers A, B, and C for IP1 and offers A and D for IP2, the response will contain offers A and B for IP1, and only offer D for IP2.

    Also note that when the duplication policy ID is 1, the offers that have been delivered via an IP with higher priority will not be delivered via this IP.

The getOffersForMultipleInteractionPoints method waits the number of milliseconds defined in the segmentationMaxWaitTimeInMS property for all re-segmentation to complete before running. Therefore, if you call a postEvent method which triggers a re-segmentation or a setAudience method immediately before a getOffers call, there may be a delay.

Return value

The runtime server responds to getOffersForMultipleInteractionPoints with a Response object with the following attributes populated:

  • AdvisoryMessages
  • ApiVersion
  • Array of OfferList
  • Profile
  • SessionID
  • StatusCode