Create a No Action Handler
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 don't want to alter your site or the collected data.
getActions
Reports an event and immediately requests a decision from Monetate.
objPersonalization.getActions(context: <ContextEnum>, requestId: <String>, includeReporting: <Bool>, arrActionTypes: <[String]>, event: <MEvent?>)Parameters:
- context is name of the event.
- requestID is the request ID for the API.
- includeReporting indicates whether the response will have impression reporting data.
- arrActionTypes is the type of actions you want to request. You can specify multiple actions in an array to handle.
- event is the data associated with the event.
Use NoAction as the action type for this method.
Code Example
String data = personalization.getActions(EventTypes.ContextIpAddress,
new IpAddress("1.0.0.0"),
new String[]
{
"monetate:action:NoAction"
},
true);getActionsData
Requests an experience decision from Monetate based off the action type.
getActionsData(requestId: <String>, includeReporting: <Bool>, arrActionTypes: <[String]>) The parameters are as follows:
- requestID is the request ID for the API.
- includeReporting indicates whether the response will have impression reporting data.
- arrActionTypes is the type of actions you want to request. You can specify multiple actions in an array to handle.
Use NoAction as the action type for this method.
NoAction using Context Layer
Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
Using the new Context Layer–based approach, NoAction Actions can be implemented using a enhanced getActions() method. Below is the sample code snippet demonstrating this usage.
For detailed information on the enhanced getActions() flow, please refer to the Context and getActions sections.
Code Eample
public void getActions(Context context, String[] actionTypes, boolean includeReports, ActionsCallback actionsCallback) {Full Code Exmaple
const context = new Context();
context.addIpAddress("1.0.0.0");
Personalization.getActions(
["monetate:action:NoAction"],
monetateContext)
.then((res: any) => console.log("Action === res", res));