Data Integration
Call to Action
Retail/Ecommerce Apps
15 min
view item when the user needs to be taken to the detail/view page of product content the app should handle the edge cases for example invalid product/item id if the user is not allowed to go to the item’s detail page (maybe because the user is not logged in) properties key value description actiontype view item type of action to be performed item item docid\ xyfflvav fzf01nmc2zn the object of the item which holds itemid, name it is similar to an item sent via view item docid\ rvoppiyuux1kaa0whsmfa event or via cms code example function oncooeectalistener(payload) { if (!payload) { return; } if (payload get("actiontype") == "view item") { const item = payload get("item"); // show given item to the user } } ts function oncooeectalistener(payload) { if (!payload) { return; } if (payload\["actiontype"] == "view item") { const item = payload\["item"]; // show given item to the user } }void oncooeectalistener(hashmap\<string, object> payload) { if (payload == null) { return; } if (payload get("actiontype") == "view item") { map\<string,object> item = (map\<string,object>) payload get("item"); // show given item to the user } }fun oncooeectalistener(payload hashmap\<string, any>) { if (payload == null) { return; } if (payload\["actiontype"] == "view item") { val item = payload\["item"] as map\<string, any>; // show given item to the user } } (void) oncooeectaresponsewithpayload (nsdictionary\<nsstring ,id> )payload { if (payload count == 0) { return; } if (\[payload\[@"actiontype"] isequal @"view item"]) { nsdictionary item = payload\[@"item"]; // show given item to the user } }func oncooeectalistener(payload \[string any]) { if (payload isempty) { return } if (payload\["actiontype"] == "view item") { let item = payload\["item"] as \[string any] // show given item to the user } } dart void inapptriggered(map\<string, dynamic> payload) { if(payload == null) { return; } if (map\["actiontype"] == "view item") { var item = payload\["item"]; // show given item to the user } } } view category when the user needs to be taken to a category page which lists all the items of that category you should take care of the edge cases for example invalid category id if the user is not allowed to go to the screen (maybe because the user is not logged in) properties key value description actiontype view category type of action to be performed category category docid\ xyfflvav fzf01nmc2zn the object of the item which holds categoryid, name it is similar to an item sent via view category docid\ rvoppiyuux1kaa0whsmfa event or via cms code example function oncooeectalistener(payload) { if (!payload) { return; } if (payload get("actiontype") == "view category") { const category = payload get("category"); // show given item to the user } } ts function oncooeectalistener(payload) { if (!payload) { return; } if (payload\["actiontype"] == "view category") { const category = payload\["category"]; // show given item to the user } }void oncooeectalistener(hashmap\<string, object> payload) { if (payload == null) { return; } if (payload get("actiontype") == "view category") { map\<string,object> category = (map\<string,object>) payload get("category"); // show given item to the user } }fun oncooeectalistener(payload hashmap\<string, any>) { if (payload == null) { return; } if (payload\["actiontype"] == "view category") { val category = payload\["category"] as map\<string, any>; // show given item to the user } } (void) oncooeectaresponsewithpayload (nsdictionary\<nsstring ,id> )payload { if (payload count == 0) { return; } if (\[payload\[@"actiontype"] isequal @"view category"]) { nsdictionary category = payload\[@"category"]; // show given item to the user } }func oncooeectalistener(payload \[string any]) { if (payload isempty) { return } if (payload\["actiontype"] == "view category") { let category = payload\["category"] as \[string any] // show given item to the user } } dart void inapptriggered(map\<string, dynamic> payload) { if(payload == null) { return; } if (map\["actiontype"] == "view category") { var category = payload\["category"]; // show given item to the user } } } add to cart when the user needs to be taken to the detail/view page of product content the app should handle the edge cases for example invalid product/item id if the user is not allowed to go to the item’s detail page (maybe because the user is not logged in) properties key value description actiontype add to cart type of action to be performed item item docid\ xyfflvav fzf01nmc2zn the object of the item which holds itemid, name it is similar to an item sent via view item docid\ rvoppiyuux1kaa0whsmfa event or via cms quantity number quantity of the item to be added to the cart code example function oncooeectalistener(payload) { if (!payload) { return; } if (payload get("actiontype") == "add to cart") { const item = payload get("item"); var quanity = payload get("quantity"); if(!quanity || quanity == 0){ quanity = 1; } // add item to the cart with given quantity } } ts function oncooeectalistener(payload) { if (!payload) { return; } if (payload\["actiontype"] == "add to cart") { const item = payload\["item"]; var quanity = payload \["quantity"]; if(!quanity || quanity == 0){ quanity = 1; } // add item to the cart with given quantity } }void oncooeectalistener(hashmap\<string, object> payload) { if (payload == null) { return; } if (payload get("actiontype") == "add to cart") { map\<string,object> item = (map\<string,object>) payload get("item"); integer quanity = (integer) payload get("quantity"); if(quanity == null || quanity == 0){ quanity = 1; } // add item to the cart with given quantity } }fun oncooeectalistener(payload hashmap\<string, any>) { if (payload == null) { return; } if (payload\["actiontype"] == "add to cart") { val screenname = payload\["item"] as map\<string, any>; var quanity\ int? = payload\["quantity"] as? int; if(quanity == null || quanity == 0){ quanity = 1; } // add item to the cart with given quantity } } (void) oncooeectaresponsewithpayload (nsdictionary\<nsstring ,id> )payload { if (payload count == 0) { return; } if (\[payload\[@"actiontype"] isequal @"add to cart"]) { nsdictionary item = payload\[@"item"]; nsinteger quantity = payload\[@"quantity"]; if(quantity == nil || quantity == 0) { quantity = 1; } // add item to the cart with given quantity } }func oncooeectalistener(payload \[string any]) { if (payload isempty) { return } if (payload\["actiontype"] == "add to cart") { let item = payload\["item"] as \[string any] var quantity = payload\["quantity"] as? int if quantity == nil || quantity == 0 { quantity = 1 } // add item to the cart with given quantity } } dart void inapptriggered(map\<string, dynamic> payload) { if(payload == null) { return; } if (map\["actiontype"] == "add to cart") { var item = payload\["item"]; var quanity = payload get("quantity"); if(quanity == null || quanity == 0){ quanity = 1; } // add item to the cart with given quantity } } } apply coupon when some coupon code needs to be applied to the cart of the user the app should take care of the different scenarios for example check the validity of the coupon handle the scenario where there are no items in the cart handle the scenario when the user is not logged in properties key value description actiontype apply coupon type of action to be performed coupon coupon docid\ xyfflvav fzf01nmc2zn object of coupon which contain couponid, code code example function oncooeectalistener(payload) { if (!payload) { return; } if (payload get("actiontype") == "apply coupon") { const coupon = payload get("coupon"); // apply coupon to cart or copy coupon code to clipboard } } ts function oncooeectalistener(payload) { if (!payload) { return; } if (payload\["actiontype"] == "apply coupon") { const coupon = payload\["coupon"]; // apply coupon to cart or copy coupon code to clipboard } }void oncooeectalistener(hashmap\<string, object> payload) { if (payload == null) { return; } if (payload get("actiontype") == "apply coupon") { map\<string,object> coupon = (map\<string,object>) payload get("coupon"); // apply coupon to cart or copy coupon code to clipboard } }fun oncooeectalistener(payload hashmap\<string, any>) { if (payload == null) { return; } if (payload\["actiontype"] == "apply coupon") { val coupon = payload\["coupon"] as map\<string, any>; // apply coupon to cart or copy coupon code to clipboard } } (void) oncooeectaresponsewithpayload (nsdictionary\<nsstring ,id> )payload { if (payload count == 0) { return; } if (\[payload\[@"actiontype"] isequal @"apply coupon"]) { nsdictionary coupon = payload\[@"coupon"]; // apply coupon to cart or copy coupon code to clipboard } }func oncooeectalistener(payload \[string any]) { if (payload isempty) { return } if (payload\["actiontype"] == "apply coupon") { let coupon = payload\["coupon"] as \[string any] // apply coupon to cart or copy coupon code to clipboard } } dart void inapptriggered(map\<string, dynamic> payload) { if(payload == null) { return; } if (map\["actiontype"] == "apply coupon") { var coupon = payload\["coupon"]; // apply coupon to cart or copy coupon code to clipboard } } } search open the search view and apply the given filters properties key value description actiontype search type of action to be performed query string content be be searched categories array of category docid\ xyfflvav fzf01nmc2zn list of category to be searched tags array of tag docid\ xyfflvav fzf01nmc2zn list of tags to be searched code example function oncooeectalistener(payload) { if (!payload) { return; } if (payload get("actiontype") == "search") { if(payload get("query")) { const query = payload get("query"); // search provided text for user } else if(payload get("categories")) { const categories = payload get("categories"); // search provided categories for user } else if(payload get("categories")) { const tags = payload get("tags"); // search provided tags for user } } } ts function oncooeectalistener(payload) { if (!payload) { return; } if (payload\['actiontype'] == 'search') { if(payload\['query']) { const query = payload\['query']; // search provided text for user } else if(payload\['categories']) { const categories = payload\['categories']; // search provided categories for user } else if(payload\['categories']) { const tags = payload\['tags']; // search provided tags for user } } }void oncooeectalistener(hashmap\<string, object> payload) { if (payload == null) { return; } if (payload get("actiontype") == "search") { if(payload get("query") != null) { string query = (string) payload get("query"); // search provided text for user } else if(payload get("categories") != null) { list\<map\<string, object>> categories = (list\<map\<string, object>>) payload get("categories"); // search provided categories for user } else if(payload get("categories") != null) { list\<map\<string, object>> tags = (list\<map\<string, object>>) payload get("tags"); // search provided tags for user } } }fun oncooeectalistener(payload hashmap\<string, any>) { if (payload == null) { return } if (payload\["actiontype"] == "search") { if(payload get("query") != null) { val query = payload get("query") as string // search provided text for user } else if(payload get("categories") != null) { val categories = payload get("categories") as list\<map\<string, any>> // search provided categories for user } else if(payload get("categories")) { val tags = payload get("tags") as list\<map\<string, any>> // search provided tags for user } } } (void) oncooeectaresponsewithpayload (nsdictionary\<nsstring ,id> )payload { if (payload count == 0) { return; } if (\[payload\[@"actiontype"] isequal @"search"]) { if(!\[payload\[@"query"] isequal nil]){ nsstring query = payload\[@"query"]; // search provided text for user } else if(!\[payload\[@"categories"] isequal nil]){ nsarray\<nsdictionary > categories = payload\[@"categories"]; // search provided categories for user } else if(!\[payload\[@"tags"] isequal nil]){ nsarray\<nsdictionary > tags = payload\[@"tags"]; // search provided tags for user } } }func oncooeectalistener(payload \[string any]) { if (payload isempty) { return } if (payload\["actiontype"] == "search") { if(payload\["query"] != nil) { let query = payload\["query"] as string // search provided text for user } else if(payload\["categories"] != nil) { let categories = payload\["categories"] as \[\[string any]] // search provided categories for user } else if(payload\["categories"] != nil) { let tags = payload\["tags"] as \[\[string any]] // search provided tags for user } } } dart void inapptriggered(map\<string, dynamic> payload) { if(payload == null) { return; } if (map\["actiontype"] == "search") { if(payload\["query"] != null) { var query = payload\["query"] as string; // search provided text for user } else if(payload\["categories"] != null) { var categories = payload\["categories"] as list\<map>; // search provided categories for user } else if(payload\["categories"] != null) { var tags = payload\["tags"] as list\<map>; // search provided tags for user } } } }