In some cases when you trigger an action, you might want to discard the collected data and do nothing. In these cases, you can direct the getActions
or getActionsData
method to perform no action. No data is returned in this case. Use this option to improve performance when you do not want to alter your site or the collected data.
getActions
Reports an event and immediately requests a decision from Monetate.
public String getActions(String context, Object event, String[] actionTypes, boolean includeReports) {returns response;}
Parameters:
context
is name of the event.event
is the data associated with the event.actionTypes
is the type of action you want to request. You can specify one action or multiple actions in an array to handle.includeReports
indicates whether the response will have impression reporting data.
Use NoAction
as the action type for this method.
Example code:
String data = personalization.getActions(EventTypes.ContextIpAddress,
new IpAddress("1.0.0.0"),
new String[]
{
"monetate:action:NoAction"
},
true);
getActionsData
This method sends the defined events to Monetate to trigger an experience. If the events fulfill the WHO settings of an experience, then that experience is triggered.
public String getActionsData(String[] actionTypes, boolean includeReports)
Parameters:
actionTypes
is the type of action you want to request. You can specify one action or multiple actions in an array to handle.includeReports
indicates whether the response will have impression reporting data.
Use NoAction
as the action type for this method.
responseData = personalization.getActionsData(new String[]{"monetate:action:NoAction"},true);