Adbrix Integration [Android]
FollowQuick Start
System Requirement
- Build Environment: Android Studio 3.x
- Min SDK version: Android API Level 14 and more.
Setting Gradle
adbrix supports SDK downloads and installation via Gradle.
Add the following to [project_name > build.gradle] file:
allprojects { repositories { google() jcenter() maven { url 'https://dl.bintray.com/igaworks-inc/IGAWORKS-AOS-SDK' } } }
allprojects { repositories { google() jcenter() maven { url 'https://dl.bintray.com/igaworks/AdbrixRmSDK' } } }
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:15.0.0' implementation 'com.android.installreferrer:installreferrer:1.0' implementation 'io.adbrix:remaster:2.0.0.1' } //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:15.0.0' implementation 'com.android.installreferrer:installreferrer:1.0' implementation('io.adbrix:remaster:2.0.0.1'){ exclude group: 'com.android.support' } }
dependencies { implementation 'com.google.android.gms:play-services-ads:15.0.0' implementation 'com.android.installreferrer:installreferrer:1.0' implementation 'com.igaworks.adbrix:abx-common-rm:+' }
[[인용:위험:보통]]* 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-service-ads
After Gradle setting is complete, click Android Studio [File > Sync Project with Gradle Files] to install SDK.
Set up Required Permissions
adbrix 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" /> ... </manifest>
SDK Initialization
Initialization of the SDK to use adbrix SDK can be completed in two ways.
- Use adbrix SDK application class
- Use developer's custom application class
Initialize SDK according to the development environment.
Using adbrix 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 adbrix 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"); if (Build.VERSION.SDK_INT >= 14) { registerActivityLifecycleCallbacks(new AbxActivityLifecycleCallbacks()); } } }
public class MyApplicationClass : Application() { override fun onCreate() { super.onCreate() AbxActivityHelper.initializeSdk(applicationContext , "your_adbrix_remastered_app_key", "your_adbrix_remastered_secret_key"); if (Build.VERSION.SDK_INT >= 14) { registerActivityLifecycleCallbacks(AbxActivityLifecycleCallbacks()) } } }
[[인용:안내:보통]]App Key & Secret Key
App Key and Secret Key are identifiers for adbrix.
These values are mandatory, and you can find them on adbrix console.
_ How to find your app key and secret key
_ adbrix 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 adbrix 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 adbrix 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); AdBrixRm.deeplinkEvent(DeeplinkOpenedActivity.this); } }
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) AdBrixRm.deeplinkEvent(this) } }
* Note: All the functions of onNewIntent(), setIntent(), deeplinkEvent() should be set in the same order as above.
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> <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 Adbrix at "your_appkey"
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 adbrix 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.
[[인용:위험:작게]] 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
By using adbrix SDK, you can analyze the in-app events and create in-app event reports in adbrix dashboard.
To analyze the in-app event, you must add adbrix event API for the point where the event is executed.
The adbrix 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 "".
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.
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.
void locationUpdate() { // Update a user's latitude and longitude AdBrixRm.setEnableLocationListening(true); }
fun locationUpdate() { // Update a user's latitude and longitude AdBrixRm.setEnableLocationListening(true) }
* 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.
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
If you set up a custom event name in almost every situation like the following example, this 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
adbrix 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.
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.
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.
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.
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.
- order id : (required) Order ID
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
- delivery charge : (optional) Delivery Charge
- payment method : (optional) Payment Method
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.
adbrix 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:
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
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.
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
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.
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
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.
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
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() } }
View an Order
You can analyze the event that users view order for final review.
The following product and order-related data are sent.
- order id : (required) Order ID
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
- delivery charge : (optional) Delivery Charge
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.
- order id : (required) Order ID
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
- penalty charge : (optional) Fee for the Cancelation/ Refund
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.
- keyword : (required) Word used to search a product
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
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.
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
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) }
View a Product List
You can analyze the event that users view a product list.
The following data of viewing product list are sent.
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
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.
- product id : (required) Product ID
- product name : (required) Product Name
- price : (required) Product Price
- quantity : (required) Purchase Quantity
- discount : (optional) Discounted Amount
- currency string : (optional) Purchase Currency Unit
- category : (optional) Product Category
- extra attr JSON : (optional) Product Details and Options
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.
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.
adbrix 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.
- setIsSkip : (required) Check whether the completion is done with the skip button.
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.
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.
- setStageName : (required) Name of Cleared Stage
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.
- setLevel : (required) Level Achieved (1~10000)
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) }
Comments
1 comment
vdj fzhi btur
Article is closed for comments.