Data Integration
Mandatory Events
Subscription Apps
10 min
purchase click when the user clicks on a button it may start the purchase this is not the after purchase event so a user may terminate the purchase flow properties 100,100,100,444 true unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type code example the following example includes optional properties too const props = { "packid" "p1234", "items" \[ { "id" "1234", "name" "item name", "category" { "id" "1234", "name" "category name" }, "ispaid" true, "hastrial" false } ], "amount" { "value" 1134 50, "currency" "usd" }, "coupon" { "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent" } }; cooeesdk sendevent("purchase click", props);const props = { 'packid' 'p1234', 'items' \[ { 'id' '1234', 'name' 'item name', 'category' { 'id' '1234', "name" 'category name' }, 'ispaid' true, 'hastrial' false } ], 'amount' { 'value' 1134 50, 'currency' 'usd' }, 'coupon' { 'id' 'foo 12345', 'code' 'free20', 'amount' 20 0, 'discounttype' 'percent' } }; cooeesdk sendevent("purchase click", props);map\<string, object> item = new hashmap<>(); item put("id", "1234"); item put("name", "item name"); item put("ispaid" true); item put("hastrial" false); map\<string, object> category = new hashmap<>(); category put("id", "1234"); category put("name", "category name"); item put("category", category); map\<string, object> amount = new hashmap<>(); amount put("value", 1134 50); amount put("name", "usd"); map\<string, object> coupon = new hashmap<>(); coupon put("id", "foo 12345"); coupon put("code", "free20"); coupon put("amount", 20 0); coupon put("discounttype", "percent"); arraylist\<map\<string, object>> items = new arraylist(); items add(item); map\<string, object> props = new hashmap<>(); props put("items", items); props put("amount", amount); props put("coupon", coupon); props put("packid", "p1234"); cooeesdk sendevent("purchase click", props);val props = mapof( "packid" to "p1234", "items" to arrayof( mapof( "id" to "1234", "name" to "item name", "category" to mapof( "id" to "1234", "name" to "category name" ), "ispaid" to true, "hastrial" to false ) ), "amount" to mapof( "value" to 1134 50, "currency" to "usd" ), "coupon" to mapof( "id" to "foo 12345", "code" to "free20", "amount" to 20 0, "discounttype" to "percent" ) ) cooeesdk sendevent("purchase click", props)nsdictionary props = @{ @"packid" @"p1234", @"items" @\[ @{ @"id" @"1234", @"name" @"item name", @"category" @{ @"id" @"1234", @"name" @"category name" }, @"ispaid" @true, @"hastrial" @false } ], @"amount" @{ @"value" @1134 50, @"currency" @"usd" }, @"coupon" @{ @"id" @"foo 12345", @"code" @"free20", @"amount" @20 0, @"discounttype" @"percent" } }; @try { \[cooeesdk sendeventwitheventname @"purchase click" eventproperties\ props error\ nil]; } @catch (nsexception exception) { nslog(@"%@", exception reason); } @finally { nslog(@"finally condition"); }let props = \[ "packid" "p1234", "items" \[ \[ "id" "1234", "name" "item name", "category" \[ "id" "1234", "name" "category name" ], "ispaid" true, "hastrial" false ] ], "amount" \[ "value" 1134 50, "currency" "usd" ], "coupon" \[ "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent", ] ] do { try cooeesdk sendevent(eventname "purchase click", eventproperties props) } catch { print("\\(error)") } dart var props = { "packid" "p1234", "items" \[ { "id" "1234", "name" "item name", "category" { "id" "1234", "name" "category name" } "ispaid" true, "hastrial" false } ], "amount" { "value" 1134 50, "currency" "usd" }, "coupon" { "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent", } }; cooeesdk sendevent("purchase click", props); consumable purchase when the user purchases a consumable content/item properties 132,100,100,444 false true unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type code example the following example includes optional properties too const props = { "packid" "p1234", "transactionid" "t1234", "items" \[ { "id" "1234", "name" "item name", "category" { "id" "1234", "name" "category name" }, "ispaid" true, "hastrial" false } ], "amount" { "value" 1134 50, "currency" "usd" }, "coupon" { "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent" } }; cooeesdk sendevent("consumable purchase", props);const props = { 'packid' 'p1234', 'transactionid' 't1234', 'items' \[ { 'id' '1234', 'name' 'item name', 'category' { 'id' '1234', "name" 'category name' }, 'ispaid' true, 'hastrial' false } ], 'amount' { 'value' 1134 50, 'currency' 'usd' }, 'coupon' { 'id' 'foo 12345', 'code' 'free20', 'amount' 20 0, 'discounttype' 'percent' } }; cooeesdk sendevent('consumable purchase', props);map\<string, object> item = new hashmap<>(); item put("id", "1234"); item put("name", "item name"); item put("ispaid" true); item put("hastrial" false); map\<string, object> category = new hashmap<>(); category put("id", "1234"); category put("name", "category name"); item put("category", category); map\<string, object> amount = new hashmap<>(); amount put("value", 1134 50); amount put("name", "usd"); map\<string, object> coupon = new hashmap<>(); coupon put("id", "foo 12345"); coupon put("code", "free20"); coupon put("amount", 20 0); coupon put("discounttype", "percent"); arraylist\<map\<string, object>> items = new arraylist(); items add(item); map\<string, object> props = new hashmap<>(); props put("items", items); props put("amount", amount); props put("coupon", coupon); props put("packid", "p1234"); props put("transactionid", "t1234"); cooeesdk sendevent("consumable purchase", props);val props = mapof( "packid" to "p1234", "transactionid" to "t1234", "items" to arrayof( mapof( "id" to "1234", "name" to "item name", "category" to mapof( "id" to "1234", "name" to "category name" ), "ispaid" to true, "hastrial" to false ) ), "amount" to mapof( "value" to 1134 50, "currency" to "usd" ), "coupon" to mapof( "id" to "foo 12345", "code" to "free20", "amount" to 20 0, "discounttype" to "percent" ) ) cooeesdk sendevent("consumable purchase", props)nsdictionary props = @{ @"packid" @"p1234", @"transactionid" @"t1234", @"items" @\[ @{ @"id" @"1234", @"name" @"item name", @"category" @{ @"id" @"1234", @"name" @"category name" }, @"ispaid" @true, @"hastrial" @false } ], @"amount" @{ @"value" @1134 50, @"currency" @"usd" }, @"coupon" @{ @"id" @"foo 12345", @"code" @"free20", @"amount" @20 0, @"discounttype" @"percent" } }; @try { \[cooeesdk sendeventwitheventname @"consumable purchase" eventproperties\ props error\ nil]; } @catch (nsexception exception) { nslog(@"%@", exception reason); } @finally { nslog(@"finally condition"); }let props = \[ "packid" "p1234", "transactionid" "t1234", "items" \[ \[ "id" "1234", "name" "item name", "category" \[ "id" "1234", "name" "category name" ], "ispaid" true, "hastrial" false ] ], "amount" \[ "value" 1134 50, "currency" "usd" ], "coupon" \[ "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent", ] ] do { try cooeesdk sendevent(eventname "consumable purchase", eventproperties props) } catch { print("\\(error)") } dart var props = { "packid" "p1234", "transactionid" "t1234", "items" \[ { "id" "1234", "name" "item name", "category" { "id" "1234", "name" "category name" } "ispaid" true, "hastrial" false } ], "amount" { "value" 1134 50, "currency" "usd" }, "coupon" { "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent", } }; cooeesdk sendevent("consumable purchase", props); subscribe when the user purchases a consumable content/item properties 133,100,100,444 false true unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type code example the following example includes optional properties too const props = { "packid" "p1234", "transactionid" "t1234", "type" "monthly", "items" \[ { "id" "1234", "name" "item name", "category" { "id" "1234", "name" "category name" }, "ispaid" true, "hastrial" false } ], "amount" { "value" 1134 50, "currency" "usd" }, "coupon" { "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent" } }; cooeesdk sendevent("subscribe", props);const props = { 'packid' 'p1234', 'transactionid' 't1234', 'type' 'monthly', 'items' \[ { 'id' '1234', 'name' 'item name', 'category' { 'id' '1234', "name" 'category name' }, 'ispaid' true, 'hastrial' false } ], 'amount' { 'value' 1134 50, 'currency' 'usd' }, 'coupon' { 'id' 'foo 12345', 'code' 'free20', 'amount' 20 0, 'discounttype' 'percent' } }; cooeesdk sendevent('subscribe', props);map\<string, object> item = new hashmap<>(); item put("id", "1234"); item put("name", "item name"); item put("ispaid" true); item put("hastrial" false); map\<string, object> category = new hashmap<>(); category put("id", "1234"); category put("name", "category name"); item put("category", category); map\<string, object> amount = new hashmap<>(); amount put("value", 1134 50); amount put("name", "usd"); map\<string, object> coupon = new hashmap<>(); coupon put("id", "foo 12345"); coupon put("code", "free20"); coupon put("amount", 20 0); coupon put("discounttype", "percent"); arraylist\<map\<string, object>> items = new arraylist(); items add(item); map\<string, object> props = new hashmap<>(); props put("items", items); props put("amount", amount); props put("coupon", coupon); props put("packid", "p1234"); props put("transactionid", "t1234"); props put("type", "monthly"); cooeesdk sendevent("subscribe", props);val props = mapof( "packid" to "p1234", "transactionid" to "t1234", "type" to "monthly", "items" to arrayof( mapof( "id" to "1234", "name" to "item name", "category" to mapof( "id" to "1234", "name" to "category name" ), "ispaid" to true, "hastrial" to false ) ), "amount" to mapof( "value" to 1134 50, "currency" to "usd" ), "coupon" to mapof( "id" to "foo 12345", "code" to "free20", "amount" to 20 0, "discounttype" to "percent" ) ) cooeesdk sendevent("subscribe", props)nsdictionary props = @{ @"packid" @"p1234", @"transactionid" @"t1234", @"type" @"monthly", @"items" @\[ @{ @"id" @"1234", @"name" @"item name", @"category" @{ @"id" @"1234", @"name" @"category name" }, @"ispaid" @true, @"hastrial" @false } ], @"amount" @{ @"value" @1134 50, @"currency" @"usd" }, @"coupon" @{ @"id" @"foo 12345", @"code" @"free20", @"amount" @20 0, @"discounttype" @"percent" } }; @try { \[cooeesdk sendeventwitheventname @"subscribe" eventproperties\ props error\ nil]; } @catch (nsexception exception) { nslog(@"%@", exception reason); } @finally { nslog(@"finally condition"); }let props = \[ "packid" "p1234", "transactionid" "t1234", "type" "monthly", "items" \[ \[ "id" "1234", "name" "item name", "category" \[ "id" "1234", "name" "category name" ], "ispaid" true, "hastrial" false ] ], "amount" \[ "value" 1134 50, "currency" "usd" ], "coupon" \[ "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent", ] ] do { try cooeesdk sendevent(eventname "subscribe", eventproperties props) } catch { print("\\(error)") } dart var props = { "packid" "p1234", "transactionid" "t1234", "type" "monthly", "items" \[ { "id" "1234", "name" "item name", "category" { "id" "1234", "name" "category name" } "ispaid" true, "hastrial" false } ], "amount" { "value" 1134 50, "currency" "usd" }, "coupon" { "id" "foo 12345", "code" "free20", "amount" 20 0, "discounttype" "percent", } }; cooeesdk sendevent("subscribe", props);