DFINERY Integration [Android]
FollowQuick Start
System Requirement
- Build Environment: Android Studio 3.x
- Min SDK version: Android API Level 14 and more.
Gradle Set-up
[[인용:위험:보통]] On 3rd May 2021, Bintray service has terminated, thus DFINERY libraries are released on mavenCentral. Please edit your Gradle set-up like the following.
DFINERY supports SDK downloads and installation via Gradle.
Add the following to [project_name > build.gradle] file:
allprojects {
repositories {
google()
mavenCentral()
}
}
Add the following dependency to [app > build.gradle > dependencies] file:
android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' implementation 'com.android.installreferrer:installreferrer:2.2' implementation 'io.dfinery:android-sdk:2.4.0.3' } // if you cannot use jetifier, android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' implementation 'com.android.installreferrer:installreferrer:2.2' implementation('io.dfinery:android-sdk:2.4.0.3'){ exclude group: 'com.android.support' } }
[[인용:위험:보통]]* To prevent fraud traffics by click injection, you should add com.android.installreferrer:installreferrer
* To acquire Google Advertising ID, you should add the following: com.google.android.gms:play-services-ads-identifier
After Gradle setting is complete, click Android Studio [File > Sync Project with Gradle Files] to install SDK.
Set up Required Permissions
DFINERY SDK requires the following permissions:
Set the following at [AndroidManifest.xml > manifest]:
<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>
SDK Initialization
Initialization of the SDK to use DFINERY SDK can be completed in two ways.
- Use DFINERY SDK application class
- Use developer's custom application class
Initialize SDK according to the development environment.
Using DFINERY SDK Application Class
If there is no application on your own development, you can initialize the SDK quickly and easily using the application class provided by DFINERY SDK.
Set the following at [AndroidManifest.xml > application]:
<application
android:name="com.igaworks.v2.core.application.AbxApplication"
...
>
<meta-data android:name="AdBrixRmAppKey" android:value="your_adbrix_remastered_app_key" />
<meta-data android:name="AdBrixRmSecretKey" android:value="your_adbrix_remastered_secret_key" />
</application>
Using Developer's custom Application Class
If there is an application class on your own development, set onCreate() as the following for the class.
<application
android:name=".MyApplicationClass"
...
>
</application>
public class MyApplicationClass extends Application { @Override public void onCreate() { super.onCreate(); AbxActivityHelper.initializeSdk(MyApplicationClass.this, "your_adbrix_remastered_app_key", "your_adbrix_remastered_secret_key"); } }
public class MyApplicationClass : Application() { override fun onCreate() { super.onCreate() AbxActivityHelper.initializeSdk(applicationContext , "your_adbrix_remastered_app_key", "your_adbrix_remastered_secret_key"); } }
[[인용:안내:보통]]App Key & Secret Key
App Key and Secret Key are identifiers for DFINERY .
These values are mandatory, and you can find them on DFINERY console.
_ How to find your app key and secret key
_ DFINERY console
ProGuard Setting
Open the proguard-rule.pro on your Android Studio and add the following.
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {*;} -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$* {*;} -dontwarn com.android.installreferrer.**
Additional SDK setup
Event uploading cycle setup
You can set the event upload cycle using an event counter or event timer.
* It is recommended to set in the activity class or application class in which the app starts.
Event counter upload
You can set the criteria of the events counter.
Use the following predefined values in the DFINERY SDK.
- AdBrixRm.AdBrixEventUploadCountInterval.MIN : 10 events
- AdBrixRm.AdBrixEventUploadCountInterval.NORMAL : 30 events
- AdBrixRm.AdBrixEventUploadCountInterval.MAX : 60 events
public class LauncherActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_launcher); // After 10 events accumulated, upload events to server AdBrixRm.setEventUploadCountInterval(AdBrixRm.AdBrixEventUploadCountInterval.MIN); } }
class LauncherActivity : Activity() { override fun onCreate() { super.onCreate() // After 10 events accumulated, upload events to server AdBrixRm.setEventUploadCountInterval(AdBrixRm.AdBrixEventUploadCountInterval.MIN) } }
Event upload timer
Set event data upload timer.
You can set criteria for the event upload timer.
Use the following predefined values in the DFINERY SDK.
- AdBrixRm.AdBrixEventUploadTimeInterval.MIN : 30 seconds
- AdBrixRm.AdBrixEventUploadTimeInterval.NORMAL : 60 seconds
- AdBrixRm.AdBrixEventUploadTimeInterval.MAX : 120 seconds
public class LauncherActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_launcher); // every 120 seconds upload event data AdBrixRm.setEventUploadTimeInterval(AdBrixRm.AdBrixEventUploadTimeInterval.MAX); } }
class LauncherActivity : Activity() { override fun onCreate() { super.onCreate() // every 120 seconds upload event data AdBrixRm.setEventUploadTimeInterval(AdBrixRm.AdBrixEventUploadTimeInterval.MAX) } }
GDPR
GDPR event can delete all of the user data when this event is called. After this event, SDK will stop working. This event cannot be undone unless the users reinstall the app after they delete the app.
void gdprForgetMeEvent() { AdBrixRm.gdprForgetMe(getApplicationContext()); }
fun gdprForgetMeEvent() { AdBrixRm.gdprForgetMe(applicationContext) }
[[인용:위험:보통]] Caution!!!
If you use gdprForgetMe API, SDK will stop collecting event data.
This setting is not reinverted unless a user install the app again.
Deeplink and DefferdDeeplink
Deeplink
Deep-link integration is different depending on the activity's launchMode.
- singleTask Mode
- Other Mode
[[인용:안내:보통]] How to check launchMode?
Open the AndroidManifest.xml file and find the activity you want to open via a deep link.
See android:launchMode.
1. If deeplink landing activity is using android:launchMode="singleTask"
You can analyze app-open events via a deep link.
Set the following for all activities that are opened via deep links:
public class DeeplinkOpenedActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); onNewIntent(DeeplinkOpenedActivity.this.getIntent()); } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); // Do something with Deeplink Intent Data setIntent(intent); // 1. Call deeplink event API AdBrixRm.deeplinkEvent(DeeplinkOpenedActivity.this); // 2. If you handle the activity lifecycle to skip 'onResume()' callback, you should implement the below code. //AdBrixRm.onResume(DeeplinkOpenedActivity.this); } @Override protected void onResume(){ super.onResume(); } }
class DeeplinkOpenedActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.deeplink_activity) onNewIntent(this.intent) } override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) setIntent(intent) // 1. Call deeplink event API AdBrixRm.deeplinkEvent(this) // 2. If you handle the activity lifecycle to skip 'onResume()' callback, you should implement the below code. //AdBrixRm.onResume(this) } override fun onResume() { super.onResume() } }
* Note: All the functions of onNewIntent(), setIntent(), deeplinkEvent() should be set in the same order as above.
[[인용:경고]] Are you handling activity lifecycle by yourself?
SDK creates deeplink event based on 'onResume()' callback.
If your app finishes your activity before the onResume() callback, you should call AdBrixRm.onResume API to create deeplink event.
Deeplink setting is required to enable the app to open via a deep link.
Set the deep link at the activities registered at [AndroidManifest.xml > manifest > application] as follows.
<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>
* Deep link is not tracked if LaunchMode of an activity opened by a deep link is Normal.
You need to change to another LaunchMode, such as SingleTask, or use AdbrixDeeplinkGateway activity.
If you are using Android AppLink set applink at registered activity from [AndroidManifest.xml > manifest > application]
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="your_appkey.adtouch.adbrix.io" /> </intent-filter>
[[인용:경고:보통]] You must use your issued Appkey from DFINERY at "your_appkey"
[[인용:위험:보통]] Checklist of Applink
1. If you want to use Applink, you should set up your tracking link as a "dynamic path". You should put deeplink value at the "deeplink_custom_path" parameter.
2. We add "is_used_abx_applink=true" to the deep link value through intent. For the accurate ad performance measurement, do not touch this value yourself.
3. Applink is optional, not mandatory.
2. If deeplink landing activity is not using android:launchMode="singleTask"
If deep link landing activity is not using android:launchMod"singleTask, you must set deep link activity like the following on Androidmanifest.xml
<activity
android:name="com.igaworks.v2.core.application.AbxDefaultDeeplinkActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:noHistory="true">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!--type deep link scheme and host -->
<data android:scheme="your_scheme" android:host="your_host" />
</intent-filter>
<!-- Set your AbxDefaultDeeplinkActivity's path at the android:value -->
<meta-data android:name="AbxRedirectActivity" android:value="com.exampleunity.UnityPlayerActivity"/>
</activity>
Deferred Deeplink
Deferred Deeplink can send the user to a certain view when the user installs the app.
[[인용:위험:작게]] - Deferred Deeplink API will send scheme data in String after the user installs the app with tracking link.
example : yourscheme://your_custom_path
1. Using a Custom Application Class
Open your Custom Application Class, add DeferredDeeplink API.
public class MyApplication extends Application implements AdBrixRM.DeferredDeeplinkListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AbxActivityHelper.initializeSdk(MyApplication.this,"your_appKey","your_secretKey"); AdBrixRm.setDeferredDeeplinkListener(this); } @Override public void onReceiveDeferredDeeplink(String urlStr) { // AdbrixRm SDk returns deferred deeplink url as string. // Use this string value and send your user to certin acivity. Log.d("Deferred Deeplink : ", urlStr); } }
class MyApplication : Application(),AdBrixRm.DeferredDeeplinkListener { override fun onCreate() { super.onCreate() AbxActivityHelper.initializeSdk(applicationContext, "your_appKey", "your_secretKey"); AdBrixRm.setDeferredDeeplinkListener(this) } override fun onReceiveDeferredDeeplink(urlStr: String) { // AdbrixRm SDk returns deferred deeplink url as string. // Use this string value and send your user to certin acivity. Log.d("Deferred Deeplink : ", urlStr) } }
2. Using AdbrixRM Application Class
If your app is using SDK's Application Class, add deferred deeplink API on the first activity called.
public class MainActivity extends Activity implements AdBrixRM.DeferredDeeplinkListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // To get deferred deeplink url, set this listener. AdBrixRm.setDeferredDeeplinkListener(this); } @Override public void onReceiveDeferredDeeplink(String urlStr) { // Adbrix SDK returns deferred deeplink url. // You can open a specific activity, change view or do whatever you want with this 'urlStr' value. Log.d("Deferred Deeplink url : ", urlStr); } }
class MainActivity : Activity(), AdBrixRm.DeferredDeeplinkListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) // To get deferred deeplink url, set this listener. AdBrixRm.setDeferredDeeplinkListener(this) } override fun onReceiveDeferredDeeplink(urlStr: String) { // Adbrix SDK returns deferred deeplink url. // You can open a specific activity, change view or do whatever you want with this 'urlStr' value. Log.d("Deferred Deeplink : ", urlStr) } }
[[인용:경고:보통]] Listener doesn't work
Please check the following.
1. Check if your conversion has occurred via the tracking link.
2. Check if you set the deep link on your tracking link.
[[인용:경고:보통]] If your app opens twice
If users install/open an app on the google play store after clicking the tracking link with deep-link, deeplinking provided by google play store will work.
Recommend you to deal with deeplink overlapping problems in your deferred deeplink listener.
[[인용:위험:작게]] If 'An operation is not implemented: Not yet implemented' error is reported
Regardless of the SDK, sometimes the error occurs when you use TODO comments within a callback method.
If there is TODO comments in the callback method, please remove it.
[[인용:위험:작게]] Cannot use Facebook SDK's fetchDeferredAppLinkData API
Adbrix DeferredDeeplink API will work instead of Facebook fetchDefrredAppLinkData API. Please delete Facebook fetchDeferredAppLinkData API.
App Event Analysis
Using DFINERY SDK, you can analyze the in-app events and create in-app event reports in the DFINERY dashboard.
To analyze the in-app event, you must add DFINERY event API for the point where the event is executed.
The DFINERY SDK provides five different types of in-app event APIs.
-
User Analysis
- Login / Logout Event
- User information
- Location information
- Custom Event Analysis
-
General Event Analysis
- Signup
- App update
- User invitation
- Use in-app credit
- In-Purchase
-
Commerce Event Analysis
- Home view
- Category view
- Product view
- Add to cart
- Add to wishlist
- Review order
- Refund
- Product search
- Product share
- Product listview
- Cart view
- Payment information
-
Game Event Analysis
- Tutorial complete
- Create character
- Stage complete
- Level up
User Analytics
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.
When logout is successful, initialize the user login data by passing an empty string such as "".
API
// When User Login AdBrixRm.login(String user_id); // When user Logout AdBrixRm.logout();
// When User Login AdBrixRm.login(String user_id) // When user Logout AdBrixRm.logout();
Sample Code
void loginAndLogoutEvent() { if(isLogin){ // When a user log on, send "user_1234" like the below AdBrixRm.login("user_1234"); }else{ // When a user log out, send empty("") string AdBrixRm.logout(); } }
fun loginAndLogoutEvent() { if(isLogin){ // When a user log on, send "user_1234" like the below AdBrixRm.login("user_1234"); }else{ // When a user log out, send empty("") string 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.
API
// Set User Age AdBrixRm.setAge(int age); // Set User Gender AdBrixRm.setGender(AdBrixRm.AbxGender abxgender); // Set other User info // value types are olny be allowed with String, Long, Double, Boolean AdBrixRm.UserProperties userProperties = new AdBrixRm.UserProperties(); userProperties.setAttrs(String key1, String value1) .setAttrs(String key2, long value2) .setAttrs(String key3, double value3) setAttrs(String key4, boolean value4); AdBrixRm.saveUserProperties(userProperties);
// Set User Age AdBrixRm.setAge(int age) // Set User Gender AdBrixRm.setGender(AdBrixRm.AbxGender abxgender) // Set other User info // value types are olny be allowed with String, long, double, boolean val userProperties = AdBrixRm.UserProperties() .setAttrs(String key1, String value1) .setAttrs(String key2, long value2) .setAttrs(String key3, double value3) setAttrs(String key4, boolean value4) AdBrixRm.saveUserProperties(userProperties)
Sample Code
void userPropertyUpdate() { // User age AdBrixRm.setAge(30); // Gender AdBrixRm.setGender(AdBrixRm.AbxGender.MALE); // Extra User Information AdBrixRm.UserProperties userProperties = new AdBrixRm.UserProperties(); userProperties.setAttrs("user_nick", "peterPark") .setAttrs("place","Seoul") .setAttrs("height",180) .setAttrs("married",false); AdBrixRm.saveUserProperties(userProperties); }
fun userPropertyUpdate() { // User age AdBrixRm.setAge(30); // Gender AdBrixRm.setGender(AdBrixRm.AbxGender.MALE); // Extra User Information val userProperties = AdBrixRm.UserProperties() .setAttrs("user_nick", "peterPark") .setAttrs("place","Seoul") .setAttrs("height",180) .setAttrs("married",false); AdBrixRm.saveUserProperties(userProperties) }
[[인용:위험:보통]]Constraints of user and event data using AttrModel
1. You can send up to 100 data.
2. The data type of Key is String and can use up to 256 letters with lowercase alphabetic characters and numbers only.
3. The Value data only be used up to 1024byte.
Location Data
You can analyze location data if you can gather geographic information.
* To receive geographic information, you need to add the android.permission.ACCESS_COARSE_LOCATION
permission to [AndroidManifest > manifest].
Custom Event
All general in-app events except purchase-related events can be analyzed.
You can analyze most in-app user actions such as 'Button click', 'Character creation', 'Tutorial completion', 'Level achievement', and so on.
API
// Custom event with AttrModel AdBrixRm.event(String eventName, AdBrixRm.AttrModel attrmodel); // Custom event without AttrModel AdBrixRm.event(String eventName);
// Custom event with AttrModel AdBrixRm.event(String eventName, AdBrixRm.AttrModel attrmodel) // Custom event without AttrModel AdBrixRm.event(String eventName)
Sample Code
void userCustomEvent() { // Additional event property AdBrixRm.AttrModel eventAttr = new AdBrixRm.AttrModel() .setAttrs("address","Seoul, Mapo-gu") .setAttrs("age", 27) .setAttrs("firsttime",true); // Click invite button AdBrixRm.event("invite_button_click",eventAttr); // Create game Character AdBrixRm.event("create_character_complete",eventAttr); // Complete tutorial AdBrixRm.event("tutorial_complete",eventAttr); // Achieve level 10 AdBrixRm.event("level_10",eventAttr); }
fun locationUpdate() { // Additional event property val eventAttr = AdBrixRm.AttrModel() .setAttrs("address", "Seoul, Mapo-gu") .setAttrs("age",27) .setAttrs("firsttime", true) // Click invite button AdBrixRm.event("invite_button_click",eventAttr) // Create game Character AdBrixRm.event("create_character_complete",eventAttr) // Complete tutorial AdBrixRm.event("tutorial_complete",eventAttr) // Achieve level 10 AdBrixRm.event("level_10",eventAttr) }
※ Warning
Setting up a custom event name in almost every situation like the following example will create tons of events.
AdBrixRm.event("custom:Lev-37 cleared,clearTime:00:00:39.2343535");
So please use an additional event parameter API(AdBrixRm.AttrModel) to manage the event.
// Addtional event parameter api AdBrixRm.AttrModel eventAttr = new AdBrixRm.AttrModel() .setAttrs("level",37) .setAttrs("clear_time_mile", 39238); // set custom event with addtional event parameter AdBrixRm.event("level_clear", eventAttr);
Common/ General Event Analytics
DFINERY provides the following type of common event:
- Registration/ Sign Up
- App Update
- User Invitation
- Credit Usage
- Payment
* To measure purchase data by media, it is required to integrate 'Purchase.'
Registration/ Sign Up
You can analyze in-app registration/sign-up events.
API
// SignUp event with Addtional signUp info AdBrixRm.Common.signUp(AdBrixRm.CommonSignUpChannel signUpChannel, AdBrixRm.CommonProperties.SignUp signUpInfo); // SignUp event without Addtional signUp info AdBrixRm.Common.signUp(AdBrixRm.CommonSignUpChannel signUpChannel);
// SignUp event with Addtional signUp info AdBrixRm.Common.signUp(AdBrixRm.CommonSignUpChannel signUpChannel, AdBrixRm.CommonProperties.SignUp signUpInfo) // SignUp event without Addtional signUp info AdBrixRm.Common.signUp(AdBrixRm.CommonSignUpChannel signUpChannel)
Sample Code
void userRegister() { try { // Additional user data AdBrixRm.AttrModel commonAttr = new AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("married", true);
// Set event model AdBrixRm.CommonProperties.SignUp signupUserInfo = new AdBrixRm.CommonProperties.SignUp() .setAttrModel(commonAttr); // Sign up API AdBrixRm.Common.signUp(AdBrixRm.CommonSignUpChannel.Google,signupUserInfo); } catch (JSONException e) { e.printStackTrace(); } }
void userRegister() { try { // Create additional user data model val signUpAttr = AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("married", true) // Set event model val signupUserInfo = AdBrixRm.CommonProperties.SignUp() .setAttrModel(signUpAttr) // Sign up API AbxCommon.signUp(AdBrixRm.CommonSignUpChannel.Google, signupUserInfo) } catch (e: Exception) { e.printStackTrace() } }
App Update
You can analyze app update events.
API
AdBrixRm.Common.appUpdate(AdBrixRm.CommonProperties.AppUpdate appUpdate);
AdBrixRm.Common.appUpdate(AdBrixRm.CommonProperties.AppUpdate appUpdate)
Sample Code
void appUpdate() { try { // Additional user data AdBrixRm.AttrModel appUpdateAttr = new AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("married", true); // AdBrixRm.CommonProperties.AppUpdate updateInfo = new AdBrixRm.CommonProperties.AppUpdate() .setPrevVersion("1.0.0a") .setCurrVersion("1.0.1a") .setAttrModel(appUpdateAttr); // App update API AdBrixRm.Common.appUpdate(updateInfo); } catch (JSONException e){ e.printStackTrace(); } }
void appUpdate() { try { // App update information val appUpdateAttr = AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("married", true) val properties = AdBrixRm.CommonProperties.AppUpdate() .setCurrVersion("1.2.0") .setPrevVersion("1.1.0") .setAttrModel(appUpdateAttr) // Call app update AP AbxCommon.appUpdate(properties) } catch (e: Exception) { e.printStackTrace() } }
User Invitation
You can analyze in-app user invitation events.
API
// UserInvite event with Addtional event info AdBrixRm.Common.invite(AdBrixRm.CommonInviteChannel inviteChannel, AdBrixRm.CommonProperties.Invite inviteInfo); // UserInvite event without Addtional event info AdBrixRm.Common.invite(AdBrixRm.CommonInviteChannel inviteChannel);
// UserInvite event with Addtional event info AdBrixRm.Common.invite(AdBrixRm.CommonInviteChannel inviteChannel, AdBrixRm.CommonProperties.Invite inviteInfo) // UserInvite event without Addtional event info AdBrixRm.Common.invite(AdBrixRm.CommonInviteChannel inviteChannel)
Sample Code
void userInvite() { try { // User invitation information AdBrixRm.AttrModel commonAttr = new AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("married", true); AdBrixRm.CommonProperties.Invite inviteInfo = new AdBrixRm.CommonProperties.Invite() .setAttrModel(commonAttr); // Call user invitation API AdBrixRm.Common.invite(AdBrixRM.CommonInviteChannel.Facebook,inviteInfo); } catch (JSONException e){ e.printStackTrace(); } }
void userInvite() { try { /// User invitation information val inviteAttr = AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("married", true) val properties = AdBrixRm.CommonProperties.SignUp() .setAttrModel(signUpAttr) // Call user invitation API AbxCommon.invite(AdBrixRm.CommonInviteChannel.Facebook, properties) } catch (e: Exception) { e.printStackTrace() } }
Credit Usage
You can analyze events for the usage of cashable credit.
API
AdBrixRm.Common.useCredit(AdBrixRm.CommonProperties.UseCredit userCreditInfo);
AdBrixRm.Common.useCredit(AdBrixRm.CommonProperties.UseCredit userCreditInfo)
Sample Code
void usingCredit() { try { // Credit usage information AdBrixRm.AttrModel commonAttr = new AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("credit", 10000) .setAttrs("age", 36) .setAttrs("married", true); AdBrixRm.CommonProperties.UseCredit userCreditInfo = new AdBrixRm.CommonProperties.UseCredit() .setAttrModel(commonAttr); //Call credit usage AdBrixRm.Common.useCredit(userCreditInfo); } catch (JSONException e){ e.printStackTrace(); } }
void usingCredit() { try { // Credit usage information val useCreaditAttr = AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("money", 1000.00) .setAttrs("married", true) val properties = AdBrixRm.CommonProperties.UseCredit() .setAttrModel(useCreaditAttr) //Call credit usage AbxCommon.useCredit(properties) } catch (e: Exception) { e.printStackTrace() } }
Payment
You can analyze in-app payment/ purchase events.
The following product and order-related data are sent in the form of arrayList.
API
AdBrixRm.Common.purchase( String orderId, List <AdBrixRm.CommerceProductModel> productModelList, double orderSale, // Optional double discount, double deleveryCharge, AdBrixRm.CommercePaymentMethod paymentMethod, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Common.purchase( String orderId, List <AdBrixRm.CommerceProductModel> productModelList, double orderSale, //Optional double discount, double deleveryCharge, AdBrixRm.CommercePaymentMethod paymentMethod, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void purchaseEvent() { try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); //Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel purchaseAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); AdBrixRm.CommonProperties.Purchase purchaseat = new AdBrixRm.CommonProperties.Purchase() .setAttrModel(purchaseAttr); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // purchase api AdBrixRm.Common.purchase("290192012", productModelArrayList, 0.00, 3500.00, AdBrixRm.CommercePaymentMethod.MobilePayment,purchaseat); } catch (JSONException e) { e.printStackTrace(); } }
fun purchaseEvent() { try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") //product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val purchaseAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) val purchaseat = AdBrixRm.CommonProperties.Purchase() .setAttrModel(purchaseAttr) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) // purchase event AbxCommon.purchase("orderid_1", proList, 0.00, 2500.00, AdBrixRm.CommercePaymentMethod.CreditCard, purchaseat) } catch (e: Exception) { e.printStackTrace() } }
Commerce Event Analytics
You can analyze purchase-related in-app events, e.g. product detail view and add to cart.
DFINERY provides the following type of commerce events:
- Home/ Main page view
- Category page/ event page view
- Product detail view
- Add to cart
- Add to wishlist
- View an order
- Cancel an order
- Search a product
- View product list
- Share the product
- View cart
- Fill in payment information
Home/ Main Page View
You can analyze the event that users view home/ main page.
void viewHomeEvent(){ // When a user enter a home activity AdBrixRm.Commerce.viewHome(); }
fun viewHomeEvent(){ // When a user enter a home activity AbxCommerce.viewHome() }
Category / Event Page View
You can analyze the event that users view category/ event page.
The product data displayed when users view category are sent in the form of the following:
API
AdBrixRm.Commerce.categoryView( AdBrixRm.CommerceCategoriesModel productCategory, List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.categoryView( AdBrixRm.CommerceCategoriesModel productCategory, List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void viewCategoryEvent(){ // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); //Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // Analyze category view events AdBrixRm.Commerce.categoryView(productCategory, productModelArrayList,commmerceAttr); }
fun viewCategoryEvent(){ // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") // product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) // Analyze category view events AbxCommerce.categoryView(productCategory, proList, commerceAttr) }
Product Detail View
You can analyze the event that users view product details.
The following product-related data are sent.
API
AdBrixRm.Commerce.productView( AdBrixRm.CommerceProductModel productMode, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.productView( AdBrixRm.CommerceProductModel productModel, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void viewProductDetailEvent(){ try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // Analyze product detail view event AdBrixRm.Commerce.productView(productModel_1,commmerceAttr); }catch (JSONException e){ e.printStackTrace();; } }
fun viewProductDetailEvent(){ try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") // product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) // Analyze product detail view event AbxCommerce.productView(productModel1, commerceAttr) } catch (e: Exception) { e.printStackTrace() } }
Add to Cart
You can analyze the event that users add products to the cart.
The following product-related data are sent.
API
AdBrixRm.Commerce.addToCart( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.addToCart( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void addToCartEvent(){ try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // Analyze add-to-cart event AdBrixRm.Commerce.addToCart(productModelArrayList,commmerceAttr); }catch (JSONException e){ e.printStackTrace(); } }
fun addToCartEvent(){ try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") // product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) // Analyze add-to-cart event AbxCommerce.addToCart(proList, commerceAttr) } catch (e: Exception) { e.printStackTrace() } }
Add to Wishlist
You can analyze the event that users add products to the wishlist.
The following product-related data are sent.
API (In case using single ProductModel)
AdBrixRm.Commerce.addToWishList( AdBrixRm.CommerceProductModel productMode, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.addToWishList( AdBrixRm.CommerceProductModel productModel, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
vvoid addToWishListEvent(){ try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // Analyze add-to-wishlist event AdBrixRm.Commerce.addToWishList(productModel_1,commmerceAttr); }catch (JSONException e){ e.printStackTrace(); } }
fun addToWishListEvent(){ try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") // product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) // addToWishList api AbxCommerce.addToWishList(productModel1, commerceAttr) } catch (e: Exception) { e.printStackTrace() } }
API (In case using multiple ProductModels)
[[인용:경고:보통]] This API can be used from Android SDK 2.4.0.0
AdBrixRm.Commerce.addToWishList( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.addToWishList( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void addToWishListEvent(){ try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // event additional info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product info arrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // Analyze add-to-wishlist event AdBrixRm.Commerce.addToWishList(productModelArrayList,commmerceAttr); }catch (JSONException e){ e.printStackTrace(); } }
fun addToWishListEvent(){ try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5") //event additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // 이벤트 추가 정보 val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) //product model val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName2") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = mutableListOf<AdBrixRm.CommerceProductModel>() proList.add(productModel1) proList.add(productModel2) //Analyze add-to-wishlist event AbxCommerce.addToWishList(proList, commerceAttr) } catch (e: Exception) { e.printStackTrace() } }
View an Order
You can analyze the event that users view order for final review.
The following product and order-related data are sent.
API
AdBrixRm.Commerce.reviewOrder( String orderId, List <AdBrixRm.CommerceProductModel> productModelList, double discount, double deleveryCharge, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.reviewOrder( String orderId, List <AdBrixRm.CommerceProductModel> productModelList, double discount, double deleveryCharge, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void reviewOrderEvent(){ try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); //Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // Analyze view-an-order event AdBrixRm.Commerce.reviewOrder("290192012", productModelArrayList, 0.00, 3500.00,commmerceAttr); } catch (JSONException e) { e.printStackTrace(); } }
fun reviewOrderEvent(){ try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") // product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) // Analyze view-an-order event AbxCommerce.reviewOrder("orderid_11", proList, 0.00, 2500.00, commerceAttr) } catch (e: Exception) { e.printStackTrace() } }
Cancel an Order / Refund
You can analyze the event that users cancel an order or claim a refund.
The following product and order-related data are sent.
API
AdBrixRm.Commerce.refund( String orderId, List <AdBrixRm.CommerceProductModel> productModelList, double penaltyCharge, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.refund( String orderId, List <AdBrixRm.CommerceProductModel> productModelList, double penaltyCharge, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void refundOrderEvent(){ try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // Analyze order cancelation/ refund event AdBrixRm.Commerce.refund("290192012", productModelArrayList, 0.00,commmerceAttr); } catch (JSONException e) { e.printStackTrace(); } }
fun refundOrderEvent(){ try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") //product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) // Analyze order cancelation/ refund event AbxCommerce.refund("orderid_22", proList, 19000.00, commerceAttr) } catch (e: Exception) { e.printStackTrace() } }
Search a Product
You can analyze the event that users search a product
The following product-related data included in the search result are sent.
API
AdBrixRm.Commerce.search( String searchKeyword, List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.search( String searchKeyword, List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void searchProductEvent(){ // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // Analyze product-search event AdBrixRm.Commerce.search("your_search_word", productModelArrayList,commmerceAttr); }
fun searchProductEvent(){ // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") //product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) // Analyze product-search event AbxCommerce.search("search_word", proList, commerceAttr) }
Share a Product
You can analyze the event that users share a product.
The following shared-product data are sent.
API (In case using single ProductModel)
AdBrixRm.Commerce.share( AdBrixRm.CommerceSharingChannel SharingChannel, AdBrixRm.CommerceProductModel productMode, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.share( AdBrixRm.CommerceSharingChannel SharingChannel, AdBrixRm.CommerceProductModel productModel, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void shareProductEvent(){ // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // Analyze share-a-product event AdBrixRm.Commerce.share(AdBrixRm.CommerceSharingChannel.KakaoTalk, productModel_1, commmerceAttr); }
fun shareProductEvent(){ // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") // product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) // Analyze share-a-product event AbxCommerce.share(AdBrixRm.CommerceSharingChannel.KakaoStory, productModel1, commerceAttr) }
API (In case using multiple ProductModels)
[[인용:경고:보통]] This API can be used from Android SDK 2.4.0.0
AdBrixRm.Commerce.share( AdBrixRm.CommerceSharingChannel SharingChannel, List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.share( AdBrixRm.CommerceSharingChannel SharingChannel, List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void addToWishListEvent(){ try { // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category11") .setCategory("category12") .setCategory("category13") .setCategory("category14") .setCategory("category15"); // Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // event additional info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product info arrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); // Analyze share event AdBrixRm.Commerce.share(AdBrixRm.CommerceSharingChannel.KakaoTalk, productModelArrayList, commmerceAttr); }catch (JSONException e){ e.printStackTrace(); } }
fun addToWishListEvent(){ try { // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5") //product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) //product model val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName2") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = mutableListOf<AdBrixRm.CommerceProductModel>() proList.add(productModel1) proList.add(productModel2) //Analyze add-to-wishlist event AbxCommerce.share(AdBrixRm.CommerceSharingChannel.KakaoStory, proList, commerceAttr) } catch (e: Exception) { e.printStackTrace() } }
View a Product List
You can analyze the event that users view a product list.
The following data of viewing product list are sent.
API
AdBrixRm.Commerce.listView( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.listView( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void listViewProductsEvent(){ // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); //Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); //Analyze view a product list event AdBrixRm.Commerce.listView(productModelArrayList,commmerceAttr); }
fun listViewProductsEvent(){ // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") //product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) //Analyze view a product list event AbxCommerce.listView(proList, commerceAttr) }
View a Cart
You can analyze the event that users view the cart.
The following data of the viewing cart are sent.
API
AdBrixRm.Commerce.cartView( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel // Optional );
AdBrixRm.Commerce.cartView( List <AdBrixRm.CommerceProductModel> productModelList, AdBrixRm.AttrModel attrModel //Optional )
Sample Code
void cartViewProductsEvent(){ // product category AdBrixRm.CommerceCategoriesModel productCategory = new AdBrixRm.CommerceCategoriesModel() .setCategory("category1") .setCategory("category2") .setCategory("category3") .setCategory("category4") .setCategory("category5"); //Additional product info AdBrixRm.AttrModel productAttr1 = new AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false); AdBrixRm.AttrModel productAttr2 = new AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true); // Additional event info AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); // product model AdBrixRm.CommerceProductModel productModel_1 = new AdBrixRm.CommerceProductModel().setProductID("5385487400") .setProductName("productName1") .setPrice(10000.00) .setQuantity(1) .setDiscount(1000.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr1); // product model AdBrixRm.CommerceProductModel productModel_2 = new AdBrixRm.CommerceProductModel().setProductID("145099811") .setProductName("productName2") .setPrice(15500.00) .setQuantity(1) .setDiscount(1200.00) .setCurrency(AdBrixRm.Currency.KR_KRW) .setCategory(productCategory) .setAttrModel(productAttr2); // product ArrayList ArrayList productModelArrayList = new ArrayList<>(); productModelArrayList.add(productModel_1); productModelArrayList.add(productModel_2); //Analyze cart viewing event AdBrixRm.Commerce.cartView(productModelArrayList,commmerceAttr); }
fun cartViewProductsEvent(){ // product category val productCategory = AdBrixRm.CommerceCategoriesModel() .setCategory("category 1") .setCategory("category 2") .setCategory("category 3") .setCategory("category 4") .setCategory("category 5") // product additional info val productAttr1 = AdBrixRm.AttrModel() .setAttrs("size", 25) .setAttrs("color", "blue") .setAttrs("vip", false) val productAttr2 = AdBrixRm.AttrModel() .setAttrs("size", 33) .setAttrs("color", "black") .setAttrs("vip", true) // event additional info val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true) // product info val productModel1 = AdBrixRm.CommerceProductModel() .setProductID("productid_1") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(5000.00) .setAttrModel(productAttr1) .setPrice(50000.00) .setQuantity(1) val productModel2 = AdBrixRm.CommerceProductModel() .setProductID("productid_2") .setProductName("productName1") .setCategory(productCategory) .setCurrency(AdBrixRm.Currency.KR_KRW) .setDiscount(10000.00) .setAttrModel(productAttr2) .setPrice(100000.00) .setQuantity(1) // product info arrayList val proList = ArrayList() proList.add(productModel1) proList.add(productModel2) //Analyze cart viewing event AbxCommerce.cartView(proList, commerceAttr) }
Fill in Payment Information
You can analyze the event that users fill in payment information.
API
AdBrixRm.Commerce.paymentInfoAdded(AdBrixRm.AttrModel attrModel);
AdBrixRm.Commerce.paymentInfoAdded(AdBrixRm.AttrModel attrModel)
Sample Code
void paymentInfoAddedEvent(){ AdBrixRm.AttrModel commmerceAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("card", "kbcard") .setAttrs("discount", true); //Event of filling in payment information AdBrixRm.Commerce.paymentInfoAdded(commmerceAttr); }
fun paymentInfoAddedEvent(){ // Payment information val commerceAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("card","kcard") .setAttrs("howmany_buy", 36) .setAttrs("discount", true)
// Payment information API AbxCommerce.paymentInfoAdded(commerceAttr) }
Gaming Event Analytics
You can analyze in-app events related to the game such as tutorial and stage.
DFINERY provides the following types of gaming event:
- Tutorial completion
- Character creation
- Stage cleared
- Level achieved
Tutorial Completion
You can analyze the event that users completed the in-app tutorial.
The following tutorial completion data is to be formed in GameProperies.TutorialComplete values and sent.
API
AdBrixRm.Game.tutorialComplete(AdBrixRm.GameProperties.TutorialComplete gameProperties);
AdBrixRm.Game.tutorialComplete(AdBrixRm.GameProperties.TutorialComplete gameProperties)
Sample Code
void tutorialCompleteEvent(){ AdBrixRm.AttrModel gameAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); AdBrixRm.GameProperties.TutorialComplete gameProperties = new AdBrixRm.GameProperties.TutorialComplete() .setIsSkip(true) .setAttrModel(gameAttr); // Tutorial complete API AdBrixRm.Game.tutorialComplete(gameProperties); }
fun tutorialCompleteEvent(){ val gameAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("level", 36) .setAttrs("google_vip", true) val tutorialProperties = AdBrixRm.GameProperties.TutorialComplete() .setIsSkip(false) .setAttrModel(gameAttr) // Tutorial complete API AbxGame.tutorialComplete(tutorialProperties) }
Character Creation
You can analyze the in-app event that users create characters.
The following character creation data is to be formed in GameProperies.CharacterCreated values and sent.
API
AdBrixRm.Game.characterCreated(AdBrixRm.GameProperties.CharacterCreated gameProperties);
AdBrixRm.Game.characterCreated(AdBrixRm.GameProperties.CharacterCreated gameProperties)
Sample Code
void characterCreatedEvent(){ AdBrixRm.AttrModel gameAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); AdBrixRm.GameProperties.CharacterCreated gameProperties = new AdBrixRm.GameProperties.CharacterCreated() .setAttrModel(gameAttr); // Create character API AdBrixRm.Game.characterCreated(gameProperties); }
fun characterCreatedEvent(){ val gameAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("level", 36) .setAttrs("google_vip", true) val characterProperties = AdBrixRm.GameProperties.CharacterCreated() .setAttrModel(gameAttr) // Create character API AbxGame.characterCreated(characterProperties) }
Stage Cleared
You can analyze the in-app event that users clear stages.
The following stage clear data is to be formed in GameProperies.StageCleared values and sent.
API
AdBrixRm.Game.stageCleared(AdBrixRm.GameProperties.StageCleared gameProperties);
AdBrixRm.Game.stageCleared(AdBrixRm.GameProperties.StageCleared gameProperties)
Sample Code
void stageClearedEvent(){ AdBrixRm.AttrModel gameAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); AdBrixRm.GameProperties.StageCleared gameProperties = new AdBrixRm.GameProperties.StageCleared() .setStageName("1-1") .setAttrModel(gameAttr); // Stage complete API AdBrixRm.Game.stageCleared(gameProperties); }
fun stageClearedEvent(){ val gameAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("level", 36) .setAttrs("google_vip", true) val stageProperties = AdBrixRm.GameProperties.StageCleared() .setStageName("stage111") .setAttrModel(gameAttr) // Stage complete API AbxGame.stageCleared(stageProperties) }
Level Achieved
You can analyze the in-app event that users achieved at certain levels.
The following achieved level data is to be formed in GameProperies.LevelAchieved values and sent.
API
AdBrixRm.Game.levelAchieved(AdBrixRm.GameProperties.LevelAchieved gameProperties);
AdBrixRm.Game.levelAchieved(AdBrixRm.GameProperties.LevelAchieved gameProperties)
Sample Code
void levelAchievedEvent(){ AdBrixRm.AttrModel gameAttr = new AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("howmany_buy", 36) .setAttrs("discount", true); AdBrixRm.GameProperties.LevelAchieved gameProperties = new AdBrixRm.GameProperties.LevelAchieved() .setLevel(1) .setAttrModel(gameAttr); // Level Acheived API AdBrixRm.Game.levelAchieved(gameProperties); }
fun levelAchievedEvent(){ val gameAttr = AdBrixRm.AttrModel() .setAttrs("grade", "vip") .setAttrs("level", 36) .setAttrs("google_vip", true) val leveProperties = AdBrixRm.GameProperties.LevelAchieved() .setLevel(12) .setAttrModel(gameAttr) // Level Achiced API AbxGame.levelAchieved(leveProperties) }