Context Layer Implementation Guide
context methods reference addallcartdata signature ios public func addallcartdata( cartlines \[cartline]?) throws description sets the complete cart information on the context object use this method when you want to provide the entire cart state in a single operation refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example ios let contextobj = contextobj() let cartlinessample = \[ cartline(sku "sku123", pid "pid123", quantity 1, currency "usd", value "19 99"), cartline(sku "sku456", pid "pid456", quantity 2, currency "usd", value "39 98") ] do { try contextobj addallcartdata(cartlinessample) } catch { print(error localizeddescription) } method signature android public void addallcartdata(cartline\[] cartlines) description sets the complete cart information on the context object use this method when you want to provide the entire cart state in a single operation refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example android cartline cartline1 = new cartline(); cartline1 setsku("sku 1"); cartline1 setpid("pid 1"); cartline1 setquantity(2); cartline1 setcurrency("us"); cartline1 setvalue("20"); cartline cartline2 = new cartline(); cartline2 setsku("sku 2"); cartline2 setpid("pid 2"); cartline2 setquantity(1); cartline2 setcurrency("us"); cartline2 setvalue("10"); context context = new context(); context addallcartdata(new cartline\[] { cartline1, cartline2 }); method signature react native addallcartdata() { cartlines(products cartline\[]) this; } description sets the complete cart information on the context object use this method when you want to provide the entire cart state in a single operation refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example addallcartdata let context = new context(); monetatecontext addsinglecartdata() product({ sku "sku 123", pid "ddsds", productid "123", quantity 1, value "1999", currency "inr", }); method signature web addallcartdata() { cartlines(products cartline\[]) this; } description sets the complete cart information on the context object use this method when you want to provide the entire cart state in a single operation refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example addallcartdata let context = new context(); monetatecontext addallcartdata() product({ sku "sku 123", pid "ddsds", productid "123", quantity 1, value "1999", currency "inr", }); addsinglecartdata method signature android public void addsinglecartdata(cartline cartline) description sets a single cart item on the context object use during add to cart operations refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example android cartline cartline = new cartline(); cartline setsku("sku"); cartline setpid("pid"); cartline setquantity(2); cartline setcurrency("us"); cartline setvalue("20"); context context = new context(); context addsinglecartdata(cartline); method signature ios public func addsinglecartdata( cartline cartline?) throws description sets a single cart item on the context object use during add to cart operations refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example ios let contextobj = contextobj() let cartline = cartline(sku "sku6", pid "pid4", quantity 3, currency "curr1", value "21") do { try contextobj addsinglecartdata(cartline) } catch { print(error localizeddescription) } notes all required fields must be populated in the cartline object method signature react native addsinglecartdata() { product(product productline) this; } description sets a single cart item on the context object use during add to cart operations refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example example let context = new context(); context addsinglecartdata() product({ sku "sku 1", pid "parent 1", productid "prod 1", quantity 1, value "50", currency "usd" }); method signature web addsinglecartdata() { product(product productline) this; } description sets a single cart item on the context object use during add to cart operations refer to the cart lines https //developer monetate com/sdks/context events parameters#rhcwp parameters usage example example let context = new context(); context addsinglecartdata() product({ sku "sku 1", pid "parent 1", productid "prod 1", quantity 1, value "50", currency "usd" }); addcustomvariablesdata method signature android public void addcustomvariablesdata(customvariable\[] customvariables) description sets one or more custom variables for business specific attributes refer to the custom variables https //developer monetate com/sdks/context events parameters#fykgn parameters usage example android customvariable customvariable1 = new customvariable(); customvariable1 setvariable("team a"); customvariable1 setvalue("winning team"); customvariable customvariable2 = new customvariable(); customvariable2 setvariable("team b"); customvariable2 setvalue("losing team"); context context = new context(); context addcustomvariablesdata( new customvariable\[] { customvariable1, customvariable2 } ); method signature ios public func addcustomvariablesdata( customvariables \[customvariablesmodel]?) throws description sets one or more custom variables for business specific attributes refer to the custom variables https //developer monetate com/sdks/context events parameters#fykgn parameters usage example ios let contextobj = contextobj() let customvariablesmodels = \[ customvariablesmodel(variable "usertype", value "premium"), customvariablesmodel(variable "loyaltylevel", value 3) ] try? contextobj addcustomvariablesdata(customvariablesmodels) method signature react native addcustomvariablesdata() { variable(variable string) this; value(value any) this; } description sets one or more custom variables for business specific attributes refer to the custom variables https //developer monetate com/sdks/context events parameters#fykgn parameters usage example react native let context = context() context addcustomvariablesdata() variable("usertype") value("premium") variable("cartvalue") value(1500) method signature web addcustomvariablesdata() { variable(variable string) this; value(value any) this; } description sets one or more custom variables for business specific attributes refer to the custom variables https //developer monetate com/sdks/context events parameters#fykgn parameters usage example web let context = context() context addcustomvariablesdata() variable("usertype") value("premium") variable("cartvalue") value(1500) addipaddress method signature android public void addipaddress(string ipaddress)public func addipaddress( ipaddress string?) throws description sets the ip address on the context object refer to the ipaddress https //developer monetate com/sdks/context events parameters#xbdip parameters usage example android context context = new context(); context addipaddress("1 0 0 0"); method signature ios public func addipaddress( ipaddress string?) throws description sets the ip address on the context object refer to the ipaddress https //developer monetate com/sdks/context events parameters#xbdip parameters usage example ios let contextobj = contextobj() try? contextobj addipaddress("192 168 1 1") method signature react native addipaddress() { ipaddress(ipaddress string) this; } description sets the ip address on the context object refer to the ipaddress https //developer monetate com/sdks/context events parameters#xbdip parameters usage example react native const context = new context(); context addipaddress("1 0 0 0"); method signature web addipaddress() { ipaddress(ipaddress string) this; } description sets the ip address on the context object refer to the ipaddress https //developer monetate com/sdks/context events parameters#xbdip parameters usage example web const context = new context(); context addipaddress("1 0 0 0"); addmetadata method signature android public void addmetadata(language language) description sets metadata on the context object currently used for language context refer to the meta data event https //developer monetate com/sdks/context events parameters#4soea parameters usage example android language language = new language(); language setlanguage("en"); context context = new context(); context addmetadata(language); method signature ios public func addmetadata(language language?) throws description sets metadata on the context object currently used for language context refer to the meta data event https //developer monetate com/sdks/context events parameters#4soea parameters usage example ios let contextobj = contextobj() let language = language(language "en us") try? contextobj addmetadata(language language) method signature react native addmetadata() { language(language string) void; } description sets metadata on the context object currently used for language context refer to the meta data event https //developer monetate com/sdks/context events parameters#4soea parameters usage example ios let contextobj = contextobj() let language = language(language "en us") try? contextobj addmetadata(language language) method signature web public func addmetadata(language language?) throws description sets metadata on the context object currently used for language context refer to the meta data event https //developer monetate com/sdks/context events parameters#4soea parameters usage example web let contextobj = contextobj() let language = language(language "en us") try? contextobj addmetadata(language language) addpagedetails method signature android public void addpagedetails( string pagetype, string url, string\[] categories, string\[] breadcrumbs, string path ) description sets page level details including pagetype , url/path , categories , and breadcrumbs refer to the page detail view event https //developer monetate com/sdks/context events parameters#ie5eb parameters usage example android context context = new context(); context addpagedetails( "home page", "https //example com", new string\[] { "category1", "category2" }, new string\[] { "breadcrumb1", "breadcrumb2" }, "abc/xyz/pqr/testpath" ); method signature ios let contextobj = contextobj() public func addpagedetails(pagetype string, path string?, url string?, categories \[string]?, breadcrumbs \[string]?) throws description sets page level details including pagetype , url/path , categories , and breadcrumbs refer to the page detail view event https //developer monetate com/sdks/context events parameters#ie5eb parameters usage example ios let contextobj = contextobj() try? contextobj addpagedetails(pagetype "home", path "path", url nil, categories \["electronics", "sale"], breadcrumbs \["home", "deals"] ) notes pagetype is mandatory either url or path is required method signature react native addpagedetails() { url(url string) this; path(path string) this; pagetype(pagetype string) this; breadcrumbs(breadcrumbs string\[]) this; categories(categories string\[]) this; } description sets page level details including pagetype , url/path , categories , and breadcrumbs refer to the page detail view event https //developer monetate com/sdks/context events parameters#ie5eb parameters usage example react native context context = new context(); context addpagedetails() url(window\ location href) path(window\ location pathname) pagetype("home") breadcrumbs(\["home"]) categories(\["homepage"]); method signature web addpagedetails() { url(url string) this; path(path string) this; pagetype(pagetype string) this; breadcrumbs(breadcrumbs string\[]) this; categories(categories string\[]) this; } description sets page level details including pagetype , url/path , categories , and breadcrumbs refer to the page detail view event https //developer monetate com/sdks/context events parameters#ie5eb parameters usage example web context context = new context(); context addpagedetails() url(window\ location href) path(window\ location pathname) pagetype("home") breadcrumbs(\["home"]) categories(\["homepage"]); addpageeventsdata method signature android public void addpageeventsdata(string\[] pageeventsdata) description sets page event identifiers on the context object refer to the page events https //developer monetate com/sdks/context events parameters#4r yd parameters usage example android context context = new context(); context addpageeventsdata(new string\[] { "eventdata1", "eventdata2" }); method signature ios public func addpageeventsdata( pageeventsdata \[string]?) throws description sets page event identifiers on the context object refer to the page events https //developer monetate com/sdks/context events parameters#4r yd parameters usage example ios let contextobj = contextobj() try? contextobj addpageeventsdata(\["pageload", "buttonclick", "formsubmit"]) method signature react native addpageeventsdata() { pageevents(events string\[]) this ; } description sets page event identifiers on the context object refer to the page events https //developer monetate com/sdks/context events parameters#4r yd parameters usage example react native context context = new context(); context addpageeventsdata() pageevents(\["click", "banner", "homepage"]); method signature react native addpageeventsdata() { pageevents(events string\[]) this ; } description sets page event identifiers on the context object refer to the page events https //developer monetate com/sdks/context events parameters#4r yd parameters usage example web context context = new context(); context addpageeventsdata() pageevents(\["click", "banner", "homepage"]); addproductdetails method signature android public void addproductdetails(product\[] productsdata) description sets product level details such as productid and sku refer to the product detail view event https //developer monetate com/sdks/context events parameters#r1pba parameters usage example android product product1 = new product(); product1 setproductid("pid1"); product1 setsku("sku1"); product product2 = new product(); product2 setproductid("pid2"); product2 setsku("sku2"); context context = new context(); context addproductdetails(new product\[] { product1, product2 }); method signature ios public func addproductdetails( productsdata \[product]?) throws description sets product level details such as productid and sku refer to the product detail view event https //developer monetate com/sdks/context events parameters#r1pba parameters usage example ios let productssample = \[ product(productid "prod001", sku "sku001"), product(productid "prod002", sku "sku002") ] let contextobj = contextobj() try? contextobj addproductdetails(productssample) method signature react native addproductdetails() { product(product { sku string; productid? string }) this; } description sets product level details such as productid and sku refer to the product detail view event https //developer monetate com/sdks/context events parameters#r1pba parameters usage example react native const context = new context(); context addproductdetails() productid("123") productsku("sku 1"); method signature react native addproductdetails() { product(product { sku string; productid? string }) this; } description sets product level details such as productid and sku refer to the product detail view event https //developer monetate com/sdks/context events parameters#r1pba parameters usage example web const context = new context(); context addproductdetails() productid("123") productsku("sku 1"); addproductthumbnailsdata method signature android public void addproductthumbnailsdata(string\[] products) ios public func addproductthumbnailsdata( products \[string]?) throws description sets product thumbnail view data refer to the product thumbnails event https //developer monetate com/sdks/context events parameters#siirq parameters usage example android context context = new context(); context addproductthumbnailsdata(new string\[] { "product21", "product43" }); ios let contextobj = contextobj() try? contextobj addproductthumbnailsdata(\["prod001", "prod002", "prod003"]) method signature ios public func addproductthumbnailsdata( products \[string]?) throws description sets product thumbnail view data refer to the product thumbnails event https //developer monetate com/sdks/context events parameters#siirq parameters usage example ios let contextobj = contextobj() try? contextobj addproductthumbnailsdata(\["prod001", "prod002", "prod003"]) method signature react native addproductthumbnailsdata() { product(product string\[]) this; } description sets product thumbnail view data refer to the product thumbnails event https //developer monetate com/sdks/context events parameters#siirq parameters usage example react native context addproductthumbnailsdata() product(\["sku 1", "sku 2", "sku 3"]); method signature web addproductthumbnailsdata() { product(product string\[]) this; } description sets product thumbnail view data refer to the product thumbnails event https //developer monetate com/sdks/context events parameters#siirq parameters usage example web context addproductthumbnailsdata() product(\["sku 1", "sku 2", "sku 3"]); addpurchasedata method signature android public void addpurchasedata(string purchaseid, purchaseline\[] purchaselinedata) description sets purchase transaction data along with purchased line items refer to the purchase event https //developer monetate com/sdks/context events parameters#f37yx and purachse lines https //developer monetate com/sdks/context events parameters#5pklq parameters usage example android purchaseline purchaseline = new purchaseline(); purchaseline setsku("sku1"); purchaseline setpid("pid1"); purchaseline setquantity(2); purchaseline setcurrency("us"); purchaseline setvalue("23 00"); context context = new context(); context addpurchasedata("1b2c3d", new purchaseline\[] { purchaseline }); method signature ios public func addpurchasedata(purchaseid string?, purchaselinedata \[purchaseline]?) throws description sets purchase transaction data along with purchased line items refer to the purchase event https //developer monetate com/sdks/context events parameters#f37yx and purachse lines https //developer monetate com/sdks/context events parameters#5pklq parameters usage example ios let purchaselinessample \[purchaseline] = \[ purchaseline(sku "sku0", pid "pid123", quantity 1, currency "usd", value "19 99"), purchaseline(sku "sku1", pid "pid456", quantity 2, currency "usd", value "39 98") ] let contextobj = contextobj() try? contextobj addpurchasedata(purchaseid "purchase123", purchaselinedata purchaselinessample) method signature react native addpurchasedata() { purchaseid(purchaseid string) this; purchaselines(products productline\[]) this; } description sets purchase transaction data along with purchased line items refer to the purchase event https //developer monetate com/sdks/context events parameters#f37yx and purachse lines https //developer monetate com/sdks/context events parameters#5pklq parameters usage example react native const context = new context(); context addpurchasedata() purchaseid("order 123") purchaselines(\[ { sku "sku 1", pid "p1", productid "123", quantity 2, value "100", currency "usd" } ]); method signature web addpurchasedata() { purchaseid(purchaseid string) this; purchaselines(products productline\[]) this; } description sets purchase transaction data along with purchased line items refer to the purchase event https //developer monetate com/sdks/context events parameters#f37yx and purachse lines https //developer monetate com/sdks/context events parameters#5pklq parameters usage example web const context = new context(); context addpurchasedata() purchaseid("order 123") purchaselines(\[ { sku "sku 1", pid "p1", productid "123", quantity 2, value "100", currency "usd" } ]); addscreensizedata method signature android public void addscreensizedata(integer screenheight, integer screenwidth) description sets screen size information usage example android context context = new context(); context addscreensizedata(211, 2313); method signature ios public func addscreensizedata(screenheight int?, screenwidth int?) description sets screen size information refer to the screensize event https //app archbee com/docs/gi3o1i4xddy584dqsyxqi/n3hsu6yazaw65bljfetrg#0aeht parameters usage example ios let contextobj = contextobj() try? contextobj addscreensizedata(screenheight 1000, screenwidth 400) method signature react native addscreensizedata() { width(width number) this; height(height number) this; } description sets screen size information refer to the screensize event https //app archbee com/docs/gi3o1i4xddy584dqsyxqi/n3hsu6yazaw65bljfetrg#0aeht parameters usage example react native context addscreensizedata() width(211) height(400); method signature web addscreensizedata() { width(width number) this; height(height number) this; } description sets screen size information refer to the screensize event https //app archbee com/docs/gi3o1i4xddy584dqsyxqi/n3hsu6yazaw65bljfetrg#0aeht parameters usage example web context addscreensizedata() width(211) height(400); addcoordinatesdata method signature android public void addcoordinatesdata(string latitude, string longitude) description sets coordinate (latitude, longitude) data refer to the coordinate event https //app archbee com/docs/gi3o1i4xddy584dqsyxqi/n3hsu6yazaw65bljfetrg#emwlu parameters usage example android context context = new context(); context addcoordinatesdata("19 0760", "72 8777"); method signature ios public func addcoordinatesdata(latitude string?, longitude string?) description sets coordinate (latitude, longitude) data usage example ios let contextobj = contextobj() try? contextobj addcoordinatesdata(latitude "37 7749", longitude " 122 4194") method signature react native addcoordinatesdata() { latitude(latitude string) this; longitude(longitude string) this; } description sets coordinate ( latitude , longitude ) data usage example react native context context = new context(); context addcoordinatesdata() latitude("12 9716") longitude("77 5946"); method signature web addcoordinatesdata() { latitude(latitude string) this; longitude(longitude string) this; } description sets coordinate ( latitude , longitude ) data usage example web context context = new context(); context addcoordinatesdata() latitude("12 9716") longitude("77 5946"); adduseragentdata method signature android public void adduseragentdata(string data) description sets user agent / device information refer to the useragent event https //app archbee com/docs/gi3o1i4xddy584dqsyxqi/n3hsu6yazaw65bljfetrg#6o rn parameters usage example android devicedetails details = new devicedetails(); details setdevice("device name here"); details setmodel("device model here"); details setosapilevel("os api level here"); details setosversion("os version here"); details setproductname("product name here"); string devicedetails = personalization refactordevicedetails(details); context context = new context(); context adduseragentdata(devicedetails); method signature android public void adduseragentdata(string data) ios public func adduseragentdata( data string?) throws description sets user agent / device information usage example android devicedetails details = new devicedetails(); details setdevice("device name here"); details setmodel("device model here"); details setosapilevel("os api level here"); details setosversion("os version here"); details setproductname("product name here"); // string devicedetails = personalization refactordevicedetails(details); string devicedetails = personalization refactordevicedetails(null); context context = new context(); context adduseragentdata(devicedetails); ios try? contextobj adduseragentdata("mozilla/5 0 (iphone; cpu iphone os 14 0 like mac os x) applewebkit/605 1 15 (khtml, like gecko) version/14 0 mobile/15e148 safari/604 1") method signature react native adduseragentdata() { useragent(useragent string) this; } description sets user agent / device information refer to the useragent event https //app archbee com/docs/gi3o1i4xddy584dqsyxqi/n3hsu6yazaw65bljfetrg#6o rn parameters usage example react native context context = new context(); context adduseragentdata() useragent("user agent"); method signature web adduseragentdata() { useragent(useragent string) this; } description sets user agent / device information refer to the useragent event https //app archbee com/docs/gi3o1i4xddy584dqsyxqi/n3hsu6yazaw65bljfetrg#6o rn parameters usage example web context context = new context(); context adduseragentdata() useragent(navigator useragent); validation & error handling all context methods validate required inputs before setting data if any required field is missing null empty the sdk throws an illegalargumentexception android try { context addipaddress("1 0 0 0"); } catch (illegalargumentexception e) { // handle validation error } all context methods validate required inputs before setting data if any required field is missing null empty the sdk throws an illegalargumentexception ios do { try contextobj addipaddress("1 0 0 0") } catch { // handle validation error } all context methods validate required inputs before setting data if any required field is missing null empty the sdk throws an illegalargumentexception react native try { context addipaddress("1 0 0 0"); } catch (err) { // handle validation error } all context methods validate required inputs before setting data if any required field is missing null empty the sdk throws an illegalargumentexception web try { context addipaddress("1 0 0 0"); } catch (err) { // handle validation error } context layer for event data reporting the context layer allows you to pass event specific data to the sdk’s reporting methods https //developer monetate com/sdks/methods#59alm reporting cart data example android // seeting up user details user user = new user(); user setdeviceid("my deviceid"); //setting up account details account account = new account("monetate mybigcommerce com", "a 3e41bf76", "p", "monetatebc"); //creating personalization instance personalization personalization = new personalization(user, account); //settingcartline data cartline cartline1 = new cartline(); cartline1 setsku("sku1"); cartline1 setpid("pid1"); cartline1 setquantity(2); cartline1 setcurrency("us"); cartline1 setvalue("20"); cartline cartline2 = new cartline(); cartline2 setsku("sku2"); cartline2 setpid("pid2"); cartline2 setquantity(1); cartline2 setcurrency("us"); cartline2 setvalue("10"); //setting data to context context context = new context(); context addallcartdata(new cartline\[] { cartline1, cartline2 }); //reporting entire cartdata personalization reportcartdata(context); ios let cartlinessample = \[ cartline(sku "sku123", pid "pid123", quantity 1, currency "usd", value "19 99"), cartline(sku "sku456", pid "pid456", quantity 2, currency "usd", value "39 98") ] let contextobj = contextobj() try? contextobj addallcartdata(cartlinessample) personalization reportcartdata(contextdata contextobj) react native const account = { account "monetate", domain "monetate", name "a 123445, instance "p", shortname "monetate", enginehostname "host name" }; const user = { deviceid "", monetateid personalization generatemonetateid(), customerid "customerid", }; const personalization = new personalization(user, account); let context = new context(); monetatecontext addallcartdata() product({ sku "sku 123", pid "ddsds", productid "123", quantity 1, value "1999", currency "inr", }); //reporting entire cartdata personalization reportcartdata(); web const account = { account "monetate", domain "monetate", name "a 123445", instance "p", shortname "monetate", enginehostname "host name" }; const user = { deviceid "", monetateid personalization generatemonetateid(), customerid "customerid", }; const personalization = new personalization(user, account); let context = new context(); monetatecontext addallcartdata() product({ sku "sku 123", pid "ddsds", productid "123", quantity 1, value "1999", currency "inr", }); //reporting entire cartdata personalization reportcartdata(); using context with getactions() the getactions https //developer monetate com/sdks/methods#djr q method retrieves experience based actions from the personalization engine the context layer provides all input signals required by the experience rules (ip, page details, product details, etc ) in single context evaluation only single data is required to satisfy the experience in multi context evaluation multiple data is required to satisy the experience example 1 single context evaluation android // seeting up user details user user = new user(); user setdeviceid("my deviceid"); //setting up account details account account = new account("monetate mybigcommerce com", "a 3e41bf76", "p", "monetatebc"); //creating personalization instance personalization personalization = new personalization(user, account); //setting data to context context context = new context(); context addipaddress("1 0 0 0"); //calling getactions personalization getactions( context, new string\[] { "monetate\ action\ omnichanneljson" }, false, new actionscallback() { @override public void onsuccess(string actions) { system out println("actions data " + actions); } @override public void onerror(exception e) { system out println("error " + e getmessage()); } } ); ios let contextobj = contextobj() try? contextobj addipaddress("1 0 0 0") objpersonalization getactions(context contextobj, arractiontypes \["monetate\ action\ omnichanneljson"], includereporting false) on(success { (actions) in self handleaction(actions actions) }) { err in print(err localizeddescription) } react native const account = { account "monetate", domain "monetate", name "a 123445, instance "p", shortname "monetate", enginehostname "host name" }; const user = { deviceid "", monetateid personalization generatemonetateid(), customerid "customerid", }; const personalization = new personalization(user, account); //setting data to context const monetatecontext = new context(); context addipaddress("1 0 0 0"); coresdkinstance getactions( \["monetate\ action\ omnichanneljson"] , monetatecontext) then((res any) => console log("action ", res)); web const account = { account "monetate", domain "monetate", name "a 123445, instance "p", shortname "monetate", enginehostname "host name" }; const user = { deviceid "", monetateid personalization generatemonetateid(), customerid "customerid", }; const personalization = new personalization(user, account); //setting data to context const monetatecontext = new context(); context addipaddress("1 0 0 0"); coresdkinstance getactions( \[], monetatecontext) then((res any) => console log("action ", res)); example 2 multi context evaluation android context context = new context(); // setting multipole data to context context addipaddress("1 0 0 0"); context addpagedetails( "home page", "https //example com", new string\[] { "category1" }, new string\[] { "breadcrumb1" }, "abc/xyz" ); // calling getactions personalization getactions( context, new string\[] { "monetate\ action\ omnichanneljson" }, false, new actionscallback() { @override public void onsuccess(string actions) { system out println("actions data " + actions); } @override public void onerror(exception e) { system out println("error " + e getmessage()); } } ); ios let contextobj = contextobj() try? contextobj addipaddress("1 0 0 0") try? contextobj addpagedetails(pagetype "home", path "deals/offers", url nil, categories \["electronics", "sale"], breadcrumbs \["home", "deals"]) objpersonalization getactions(context contextobj, arractiontypes \["monetate\ action\ omnichanneljson"], includereporting false) on(success { (actions) in self handleaction(actions actions) }) { err in print(err localizeddescription) } react native const account = { account "monetate", domain "monetate", name "a 123445, instance "p", shortname "monetate", enginehostname "host name" }; const user = { deviceid "", monetateid personalization generatemonetateid(), customerid "customerid", }; const personalization = new personalization(user, account); //setting data to context const monetatecontext = new context(); context addipaddress("1 0 0 0"); monetatecontext addallcartdata() product({ sku "sku 123", pid "ddsds", productid "123", quantity 1, value "1999", currency "inr", }); coresdkinstance getactions( \["monetate\ action\ omnichanneljson" ], monetatecontext) then((res any) => console log("action ", res)); web const account = { account "monetate", domain "monetate", name "a 123445, instance "p", shortname "monetate", enginehostname "host name" }; const user = { deviceid "", monetateid personalization generatemonetateid(), customerid "customerid", }; const personalization = new personalization(user, account); //setting data to context const monetatecontext = new context(); context addipaddress("1 0 0 0"); monetatecontext addallcartdata() product({ sku "sku 123", pid "ddsds", productid "123", quantity 1, value "1999", currency "inr", }); coresdkinstance getactions( \["monetate\ action\ omnichanneljson" ], monetatecontext) then((res any) => console log("action ", res)); the sdk evaluates all data present inside the context object and returns the appropriate actions