DFINERY Integration [Flutter]
Follow
[[인용:위험:작게]] 2021.3.8 iOS Null Safty is available on DFINERY Flutter SDK.
SDK Install and Initialize
This guide is to install DFINERY SDK for the Flutter project and initializes it.
SDK Installation.
Add dependencies for DFINERY SDK at pubspec.yaml file, and open the terminal at your project directory run 'flutter pub get'.
dependencies: adbrixrm_flutter: ^1.5.0
Additional Android Setting
This guide is to set for an additional Android setting at the Flutter project. You must add these settings to DFINERY SDK to work properly on Android.
build.gradle Setting
Add dependencies at the Flutter project folder -> Android -> app folder build.gradle file.
dependencies { implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' implementation 'com.android.installreferrer:installreferrer:2.2' }
[[인용:위험:보통]]* Add com.android.installreferrer:installreferrer to detect Fraud traffic.
* To get Google Advertiser ID please add com.google.android.gms:play-service-ads
Androidmanifest.xml permission setting
Add these permission at AndroidManifest.xml
<manifest> ... <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" /> ... </manifest>
ProGuard Setting
Add these code at app / proguard-rule.pro for DFINERY SDK.
## Flutter wrapper -keep class io.flutter.app.** { *; } -keep class io.flutter.plugin.** { *; } -keep class io.flutter.util.** { *; } -keep class io.flutter.view.** { *; } -keep class io.flutter.** { *; } -keep class io.flutter.plugins.** { *; } -dontwarn io.flutter.embedding.* ## DFINERY -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {*;} -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$* {*;} -dontwarn com.android.installreferrer
Additional iOS Setting
This guide is to set for an additional iOS setting at the Flutter project. You must add these settings to DFINERY SDK to work properly on iOS.
Add Framework
You need to add iAd frameworks and AdServices frameworks to your project.
Go to [General > Frameworks, Libraries, and Embedded Content], and click (+). Add "iAd.framework" and "AdServices.frameworks" on the pop-up.
If you target iOS 14.2, you need to set up the status of AdServices.framwork as Optional. Go to [Build Phases > Link Binary With Libraries] and set the status.
Swift Library
DFINERY SDK uses Swift Library. Move to [Build Settings > Always Embed Swift Standard Libraries] and set value as 'yes'.
SDK Initialize
Go to main.dart and add initState on First Widget app opened. add AdBrixRm.sdkInit API.
import 'package:adbrixrm_flutter/adbrixrm.dart'; . . . class _MyAppState extends State <MyApp> { bool getIdfa = false; @override void initState() { super.initState(); // delayTime added for iOS AppTrackingTransparency popup for get IDFA // delayTime only works on iOS AdBrixRm.sdkInit(appKey: 'your_app_key', secretKey: 'your_secret_key', delayTime :3 ); //get AppTrackingTransparency result and set IDFA if (_getIdfa == true) { AdBrixRm.startGettingIDFA(); } else { AdBrixRm.stopGettingIDFA(); } } }
[[인용:안내:보통]]Check your AppKey / SecretKey
_ AppKey and SecretKey is to define the App at DFINERY .
_ These keys are must need to integrate SDK. You can find these keys on DFINERY Console.
How to find Appkey and SecretKey? / Go to DFINERY Console
[[인용:안내:보통]] Congratulation!!
Now you finished basic integration for DFINERY SDK.
You can use these function with basic integration.
1. DAU, MAU, Daily Retention reporting.
2. App installation campaign report like NCP.
Additional SDK Setting
Event upload cycle : By event count
Set event data to be uploaded to the DFINERY server when the preset counts of events are accumulated.
Use the following predefined values in the DFINERY SDK.
- AdBrixRM.AdBrixEventUploadCountInterval.MIN : 10count
- AdBrixRM.AdBrixEventUploadCountInterval.NORMAL : 30count
- AdBrixRM.AdBrixEventUploadCountInterval.MAX : 60count
AdBrixRm.setEventUploadCountInterval( interval: AdBrixEventUploadCountInterval.MIN);
Event upload cycle : By the timer
Set event data to be uploaded to the DFINERY server after the preset time has elapsed.
Use the following predefined values in the DFINERY SDK.
- AdBrixRM.AdBrixEventUploadTimeInteval.MIN : 30seconds
- AdBrixRM.AdBrixEventUploadTimeInteval.NORMAL :60seconds
- AdBrixRM.AdBrixEventUploadTimeInteval.MAX :120seconds
AdBrixRm.setEventUploadTimeInterval( interval: AdBrixEventUploadTimeInterval.MIN);
GDPR
GDPR event can delete all of the user data when this event called. After this event call, SDK will stop working. This event cannot be undone unless the users re-install the app after they delete the app.
AdBrixRm.gdprForgetMe();
Deeplink Event
This guide is for integrating deeplink event.
Android Setting
Go to [AndroidManifest.xml > manifest > application] and Add this deeplink scheme and host.
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="your_scheme" android:host="your_host" /> </intent-filter>
Add these code on MainActivity.java.
public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); onNewIntent(this.getIntent()); } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); } }
iOS
Go to [General > Target > Info > URL Types] and set URL Scheme.
Go to AppDelegate.swift and add application(_ app: open url: options: ) delegate. On this function add deeplink tracking code.
import AdBrixRmKit . . . func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { // AdBrixRM instance let adBrix = AdBrixRM.getInstance // deeplink open tracking code adBrix.deepLinkOpen(url: url) return false }
Flutter
After each platform setup, add these codes on main.dart.
import 'adbrixrm_flutter/adbrixrm.dart' . . . // Use WidgetsBindingObserver to use didChangeAppLifecycleState. class _MyAppState extends State <MyApp> with WidgetsBindingObserver { @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); AdBrixRm.sdkInit(appKey: 'your_app_key', secretKey: 'your_secret_key'); // deeplink data may not come as soon as app open. So we recommend give some dely. // It will return null when sdk don't have deeplink value to return Timer(Duration(seconds: 5),() { // Only Android Needed on initState if (Platform.isAndroid) { String? deeplink = await AdBrixRm.adbrixDeeplink; } }); } // get Deeplink data when app is on Resume // It will return null when sdk don't have deeplink value to return @override void didChangeAppLifecycleState(AppLifecycleState currentState) { if (currentState == AppLifecycleState.resumed) { String? deeplink = await AdBrixRm.adbrixDeeplink; } } }
[[인용:위험:작게]] AdBrixRm.adbrixDeeplink only returns data when the app is opened by DFINERY tracking link.
Deferred Deeplink Event
To get Deferred deeplink data add these code on main.dart.
import 'adbrixrm_flutter/adbrixrm.dart' . . . class _MyAppState extends State with WidgetsBindingObserver { String _deeferredDeeplink; @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); AdBrixRm.sdkInit(appKey: 'your_app_key', secretKey: 'your_secret_key'); // deferredDeeplink data may not come as soon as app open. So we recommend give some dely. // It will return null when sdk don't have deferreddeeplink value to return Timer(Duration(seconds: 5),() { String? deferredDeeplink = await AdBrixRm.adbrixDeferredDeeplink; }); } }
[[인용:위험:작게]] AdBrixRm.adbrixDeferredDeeplink only returns data when the app is installed by DFINERY tracking link.
User Analysis
Login / Logout event
You can analyze your app users' login and logout events.
When login is successful, send user ID (user defining parameter) as following.
void login() { if(loginSuccess) { AdBrixRm.login(userId:'myUserID'); } else { AdBrixRm.logout(); } }
* Please be careful not to include any personal information in the user ID being sent. If personal information such as email or phone number is included, it is recommended to properly encrypt the data by BASE64, MD5, SHA1, and etc.
User Properties
You can analyze user properties such as age, gender, and others.
void userPropertiesUpdate() { // Set Age AdBrixRm.setAge(age:36); // Set Gender AdBrixRm.setGender(gender : AdBrixGender.MALE); //Addtional UserInfo Map<String, dynamic> properties = <String, dynamic>{ 'adress' : 'Mapo-gu Seoul Korea', 'appmoney': 100.50, 'married' : true }; AdBrixRm.setUserProperties(properties: properties); }
[[인용:위험:보통]] Constraints for Event Properties (attr) using Map object
1.No more than 100 information
2. Key is using String type and no more than 256 letters. Only be use the low-case alphabet.
3. Values can be used no more than 1024 byte.
4. Values are only be used String, int, long, double, and bool type.
5. From now on all events which using Map object, apply the same constraints rule.
CI Property
Set Customer Identifier information. These data can not be used for Analytics. This infomation only be used on Kakao push and GrowthAction.
void ciPropertiesUpdate() { // Set KakaoID AdBrixRm.setKakaoId(kakaoId: 'myKakaoId123'); //Addtional UserInfo Map<String, dynamic> ciProperty = <String, dynamic>{ 'custom_info_1' : 'my_Custom_Ci_info', 'custom_info_2': 500000, 'custom_info_3' : true, 'custom_info_4': 150.50, }; AdBrixRm.setCiProperties(properties: ciProperty); }
Common Event
DFINERY provides the following type of common event:
- Registration / sign up
- App update
- User invitation
- Use credit
- Purchase
* To measure purchase data by media, it is required to integrate 'Purchase.'
Registration /sign up
You can analyze in-app registration/sign up event.
- channel : (Required) Registration channel (type : AdBrixSignUpChannel)
- attr : (Optional) Additional event information (type : Map<String, dynamic>)
void signUp() { // set Addtional Event Value (Optional) Map<String, dynamic> properties = <String, dynamic>{ 'local' : 'Seoul', 'date' : '2020-10-31', 'channel' : 1 }; AdBrixRm.commonSignUp(channel: AdBrixSignUpChannel.Naver, attr: properties); }
App Update
You can analyze app update event.
- preVersion : (Required) Previous version name (type : String)
- currVersion : (Required) Current version name (type : String)
- attr : (Optional) Additional event information (type : Map<String, dynamic>)
void appUpdate() { // set Addtional Event Value (Optional) Map<String, dynamic> properties = <String, dynamic>{ 'appmarket': 'GooglePlay', 'device': 'google', 'autoupdate': true, }; AdBrixRm.commonAppUpdate( preVersion: '2.0.0', currVersion: '3.0.0', attr: properties); }
User Invitation
You can analyze in-app user invitation event.
- inviteChannel : (Required) User invitation channel (type : AdBrixInviteChannel)
- attr : (Optional) Additional event information (type : Map<String, dynamic>)
void userInvite() { // set Addtional Event Value (Optional) Map<String, dynamic> properties = <String, dynamic>{ 'currentplace': 'Seoul', 'friends': 36, 'credit': 180.50, }; AdBrixRm.commonUserInvite( inviteChannel: AdBrixInviteChannel.Kakao, attr: properties); }
Use Credit
You can analyze events for the usage of cashable credit.
- attr : (Optional) Additional event information (type : Map<String, dynamic>)
void useCredit() { //set Addtional Event Value (Optional) Map<String, dynamic> properties = <String, dynamic>{ 'local': 'Seoul', 'age': 36, 'height': 180.50, 'creditused': 200.0 }; AdBrixRm.commonUseCredit(attr: properties) }
Purchase
You can analyze an in-app payment/ purchase event.
All product information (AdBrixRmCommerceProductModel) set as list.
AdBrixRmCommerceProductModel
- productId : (Required) Product ID (type : string)
- productName: (Required) Product Name (type : string)
- price: (Required) : Product price (type : double)
- discount : (Required) Discount price (type : double)
- quantity : (Required) Quantity (type : int)
- currency : (Required) Currency unit (type : AdBrixCurrency)
- category : (Required) Product category. (type : AdBrixRmCommerceCategoryModel)
- productattr : (Optional) Additional product information (type : Map<String, dynamic>)
[[인용:경고:보통]] All commerce event using AdBrixRmCommerceProductModel use same syntax.
commPurchase event
- order id : (Required) Order Number or ID(type : string)
- productList : (Requried) Product list with AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- orderSales : (Required) Total order sales price (type : double)
- discount : (Required) Discount price (type: double)
- deliveryCharge : (Required) Delivery Charge(type : double)
- paymentMethod : (Required) Method of payment (type : AdBrixPaymentMethod)
- attr : (Optional) Additional event information (type : Map<String, dynamic>)
void purchase() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commonPurchase( orderId: 'myorderid', productList: productlist, orderSale : 755000.0 discount: 1000.0, deliveryCharge: 2500.0, paymentMethod: AdBrixPaymentMethod.MobilePayment, attr: eventproperties); }
Custom Event
You can define an event name in which DFINERY is not a pre-defined event name.
- eventName: (Required) Event Name (type : string)
- attr : (Optional) Additional event information (type : Map<String, dynamic>)
void customEvent() { //set Addtional Event Value (Optional) Map<String, dynamic> attr = <String, dyanamic>{ 'local': 'Seoul', 'age': 36, 'height': 180.00 }; AdBrixRm.events(eventName: 'your_event_name', attr: attr); }
Commerce Event
You can analyze in-app commerce event like product view, add to cart, etc using DFINERY SDK API.
DFINERY SDK provides 12 pre-defined commerce API
- vewiHome
- categoryView
- productView
- addToCart
- addToWishlist
- reviewOrder
- refund
- search
- share
- listview
- cartView
- paymentInfo
viewHoime
You can analyze event which user viewing the main screen on your app, using DFINERY SDK API.
void viewHome() { AdBrixRm.commerceViewHome(); }
categoryView
You can analyze event which user entering certain product category using DFINERY SDK API.
- categoryModel : (Required) Category list (type : AdBrixRmCommerceCategoryModel )
- productList : (Required) List of AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void categoryView () { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; // Make CategoryList for catagoryView Event AdBrixRmCommerceCategoryModel eventCategoryModel = AdBrixRmCommerceCategoryModel.create( category1: 'eventcategory1', category2: 'eventcategory2', category3: 'eventcategory3', category4: 'eventCategory4', category5: 'eventCategory5'); AdBrixRm.commerceCategoryView ( categoryModel: eventCategoryModel, productList: productlist, attr: eventproperties); }
productView
You can analyze event which user entering certain product using DFINERY SDK API
- productModel : (Required) Product Information (type : AdBrixRmCommerceProductModel)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void productView () { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceProductView( productModel: adBrixRmCommerceProductModel1, attr: eventproperties); }
addToCart
You can analyze event which user add a certain product to cart using DFINERY SDK API
- productList : (Required) List of AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void addtocart() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceAddToCart( productList: productlist, attr: eventproperties); }
addToWishlist
You can analyze event which user add a certain product to wishlist using DFINERY SDK API
- productModel : (Required) Product Information (type : AdBrixRmCommerceProductModel)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void addtowishlist() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceAddToWishList( productModel: adBrixRmCommerceProductModel1, attr: eventproperties); }
reviewOrder
You can analyze event which user reviewing user's product order using DFINERY SDK API
- orderId : (Required) Purchase order number or ID (type : string)
- productList : (Required) List of AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- discount : (Required) Discount price (type: double)
- delivery charge : (Required) Delivery Price (type : double)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void reviewOrder() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceReviewOrder( orderId: 'myOrderID', productList: productlist, discount: 5000.0, deliveryCharge: 2500.0, attr: eventproperties); }
refund
You can analyze event which user cancel product order using DFINERY SDK API.
- orderId : (Required) Purchase order number or ID (type : string)
- productList : (Required) List of AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- penaltyCharge : (Required) Penalty charge for canceling order (type: double)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void refund() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceRefund( orderId: 'myOrderID', productList: productlist, penaltyCharge: 5000.0, attr: eventproperties); }
search
You can analyze event which user search certain product using DFINERY SDK API.
- keyword : (Required) Search keyword (type : string)
- productList : (Required) List of AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void search() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceSearch( keyword: 'your_keyword', productList: productlist, attr: eventproperties); }
share
You can analyze event which user share certain product using DFINERY SDK API.
- sharingChannel : (Required) Sharing Channel (type : AdBrixSharingChannel)
- productModel : (Required) Product Information (type : AdBrixRmCommerceProductModel)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void share() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceShare( sharingChannel: AdBrixSharingChannel.KAKAOSTORY, productModel: adBrixRmCommerceProductModel1, attr: eventproperties); }
listView
You can analyze event which user viewing product list using DFINERY SDK API.
- productList : (Required) List of AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void listView() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceListView( productList: productlist, attr: eventproperties); }
cartView
You can analyze event which user viewing cart using DFINERY SDK API.
- productList : (Required) List of AdBrixRmCommerceProductModel (type : List<AdBrixRmCommerceProductModel>
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void cartView() { // Set Product // product info (Optional) Map<String, dynamic> productInfo = <String, dynamic>{ 'productbrand': 'AIR_Product', 'limited': 35000, 'currentsale': 3000, 'salesleft': 0.30, 'sale': false }; // Create Product AdBrixRmCommerceProductModel adBrixRmCommerceProductModel1 = AdBrixRmCommerceProductModel.create( productId: 'myproductId', productName: 'productNametest', price: 1000000.0, discount: 250000.0, quantity: 1, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1'), productAttr: productInfo); AdBrixRmCommerceProductModel adBrixRmCommerceProductModel2 = AdBrixRmCommerceProductModel.create( productId: 'productID 2', productName: 'productName2', price: 15000.0, discount: 2500.0, quantity: 3, currency: AdBrixCurrency.KR_KRW, category: AdBrixRmCommerceCategoryModel.create(category1: 'categoryTest1')); // Make a List for ProductModel List<AdBrixRmCommerceProductModel> productlist = <AdBrixRmCommerceProductModel>[]; productlist.add(adBrixRmCommerceProductModel1); productlist.add(adBrixRmCommerceProductModel2); //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'deliveryadress': 'Seoul', 'remaindate': 7, 'mil': 25000.23, 'vip': true }; AdBrixRm.commerceCartView( productList: productlist, attr: eventproperties); }
paymentInfo
You can analyze event which user reviewing payment information using DFINERY SDK API.
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void paymentInfoAdd() { //set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'local': 'Seoul', 'age': 36, 'height': 180.50, }; AdBrixRm.commercePaymentInfoAdd(attr: eventproperties); }
Game Event
You can analyze in-game event like level up, stage complete, etc using DFINERY SDK API.
DFINERY SDK provides 4 pre-defined game API
- tutorialComplete
- characterCreated
- stageComplete
- levelUp
tutorialComplete
You can analyze event which user complete game tutorial using DFINERY SDK API.
- isSkip : (Required) set tutorial skipped or not (type : bool)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void tutorialCompleted() { // set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'local': 'Seoul', 'age': 36, 'height': 180.50, }; AdBrixRm.gameTutorialComplete(isSkip: true, attr: eventproperties); }
characterCreated
You can analyze event which user create a game character using DFINERY SDK API.
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void characterCreated() { // set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'local': 'Seoul', 'caractername': 'myCharacterName', 'age': 36, 'height': 180.50, }; AdBrixRm.gameCharacterCreated(attr: eventproperties); }
stageComplete
You can analyze event which user complete game certain stage using DFINERY SDK API.
- stageName : (Required) Name of completed stage (type : string)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void stageCleared() { // set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'local': 'Seoul', 'age': 36, 'height': 180.50, }; AdBrixRm.gameStageCleared(stageName: '11-5', attr: eventproperties); }
levelUp
You can analyze event which user level up in game using DFINERY SDK API.
- levelAchieved : (Required) current character level (type: int)
- attr : (Optional) Addtional event information (type : Map<String, dynamic>)
void levelAchieved() { // set Addtional Event Value (Optional) Map<String, dynamic> eventproperties = <String, dynamic>{ 'local': 'Seoul', 'age': 36, 'height': 180.50, }; AdBrixRm.gameLevelAchieved(levelAchieved: 33, attr: eventproperties); }