Actions
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 sdk methods or sdk methods 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 getactions method getactions(actiontype, context?, eventdata?, includereporting?) promise\<any> the parameters are as follows actiontype is the type of action you want to request you can specify one action or multiple actions in an array to handle context is name of the event eventdata is the data associated with the event includereporting indicates whether the response will have impression reporting data use noaction as the action type for this method getactions method getactions(actiontype, context?, eventdata?, includereporting?) promise\<any> the parameters are as follows actiontype is the type of action you want to request you can specify one action or multiple actions in an array to handle context is name of the event eventdata is the data associated with the event includereporting indicates whether the response will have impression reporting data use noaction as the action type for this method getactions method 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 getactions method public string getactions(string context, object event, string\[] actiontypes, boolean includereports) {returns response;} the parameters are as follows actiontypes is the type of action you want to request you can specify one action or multiple actions in an array to handle context is name of the event eventdata is the data associated with the event includereporting indicates whether the response will have impression reporting data use noaction as the action type for this method code example getactions example let recdata; personalizationinstance getactions("monetate\ action\ noaction") then(res => { recsdata = res\[0] actions; }) catch(error => { console warn('error!', error); }); getactions example let recdata; personalizationinstance getactions("monetate\ action\ noaction") then(res => { recsdata = res\[0] actions; }) catch(error => { console warn('error!', error); }); getactions example import marqueelabel import uikit import monetate ios sdk class categoryviewcontroller uiviewcontroller { final var objpersonalization = personalization( account account( instance "p", domain "localhost org", name "a 701b337c", shortname "localhost"), user user(deviceid "62bd2e2d 213d 463f 83bb 12c0b2530a14")) override func viewdidload() { super viewdidload() } override func viewwillappear( animated bool) { super viewwillappear(animated) noactionevent() } func noactionevent() { objpersonalization getactions( context pageview, requestid "test request id", includereporting true, arractiontypes \["monetate\ action\ noaction"], event pageview( pagetype "homepage", path "n/a", url "n/a", categories \[], breadcrumbs \[]) ) on { (res) in if res status == 200 { let data = json(res data) print(data) self handleaction(res res) } else { } } } } getactions 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 method getactionsdata(actiontype array\<string>, includereporting? boolean) promise\<any> the parameters are as follows 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 getactionsdata method getactionsdata(actiontype array\<string>, includereporting? boolean) promise\<any> the parameters are as follows 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 getactionsdata method 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 getactionsdata method public string getactionsdata(string\[] actiontypes, boolean includereports) the parameters are as follows 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 getactionsdata example let recdata; personalizationinstance getactionsdata("monetate\ action\ noaction") then(res => { recsdata = res\[0] actions; }) catch(error => { console warn('error!', error); }); getactionsdata example let recdata; personalizationinstance getactionsdata("monetate\ action\ noaction") then(res => { recsdata = res\[0] actions; }) catch(error => { console warn('error!', error); }); getactionsdata example responsedata = personalization getactionsdata(new string\[]{"monetate\ action\ noaction"},true);