You define the following items to meet the requirements for the cell phone plan summary page.
One offer to be displayed in a zone that is dedicated to offers about upgrades
Interaction point: ip_planSummaryBottomRightEvent: evt_logOfferInteraction point: ip_planSummaryTopRightInteraction point: ip_planSummaryBottomLeftFor analysis, you need to log which offers are accepted, and which are rejected.
Event: evt_offerAccept
Event: evt_offerReject
Response response=getOffers(
sessionID, ip_planSummaryBottomRight, 1)Now that you are displaying the offer, you want to log it as a contact.
NameValuePair evtParam_TreatmentCode = new NameValuePairImpl();
evtParam_TreatmentCode.setName("UACIOfferTrackingCode");
evtParam_TreatmentCode.setValueAsString(offer.getTreatmentCode());
evtParam_TreatmentCode.setValueDataType(NameValuePair.DATA_TYPE_STRING);
postEvent(
sessionID, evt_logOffer,
evtParam_TreatmentCode)Instead of calling each of these methods singularly, you can use the executeBatch method, as shown in the following example for the planSummaryBottomLeft portion of the web page.
You do not need to define the UACIOfferTrackingCode in this example because the Interact the Interact runtime server automatically logs the last recommended list of treatments as contacts if you do not supply the UACIOfferTrackingCode.
Response response=getOffers(
sessionID, ip_planSummaryBottomLeft, 3)
OfferList offerList=response.getOfferList();
if(offerList.getRecommendedOffers() != null)
{
for(int x=0;x<3;x++)
{
Offer offer = offerList.getRecommendedOffers()[x];
if(x==0)
{
// grab offerimg attribute value and store somewhere;
// this will be the first image to display
}
else if(x==1)
{
// grab offerimg attribute value and store somewhere;
// this will be the second image to display
}
else if(x==2)
{
// grab offerimg attribute value and store somewhere;
// this will be the third image to display
}
}
}You must write your client code fetch from the local cache and log to contact only once for each offer after its image has been displayed. To log the contact, the UACITrackingCode parameter needs to be posted as before. Each offer will have a different tracking code.
postEvent(
sessionID, evt_offerAccept,
evtParam_TreatmentCodeSTR)
postEvent(
sessionID, evt_offerReject,
evtParam_TreatmentCodeSBR)
postEvent(
sessionID, evt_offerReject,
evtParam_TreatmentCodeSBL)In practice, it would be best to send these three postEvent calls with the executeBatch method.
IBM Unica Interact
8.5.0
|
Copyright IBM Corporation 2011. All Rights Reserved.
|
For more information, see our support and community site: Customer Central
|
|