Adbrix Integration [Android Java]
FollowQuick Start
System Requirement
- Build Enviroment : 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() flatDir { dirs 'libs' } maven { url 'https://dl.bintray.com/igaworks/AdbrixRmSDK' } } }
Add the following dependency to [app > build.gradle > dependencies] file:
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 use Google Play Install Referrer API in order to prevent fraud traffics by click injection, you MUST add the following: com.android.installreferrer:installreferrer
* To acquire Google Advertising ID, you MUST add the following: com.google.android.gms:play-service-ads
Setting 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" /> <!-- OPTIONAL --> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> ... </manifest>
Setting AppKey and SecretKey
Set the adbrix AppKey and SecretKey issued from adbrix console.
Set the following at [AndroidManifest.xml > manifest > application]:
<application> ... <meta-data android:name="AdBrixRmAppKey" android:value="your_adbrix_remaster_app_key" /> <meta-data android:name="AdBrixRmSecretKey" android:value="your_adbrix_remaster_secret_key" /> ... </application>
Setting Install Broadcast Receiver
To use attribution features of adbrix, Broadcast Receiver is required for INSTALL_REFERRER.
Set the following to [AndroidManifest.xml > manifest > application]
<application> ... <receiver android:name="com.igaworks.v2.core.AbxReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver> ... </application>
* If there is another Broadcast Receiver for INSTALL_REFERRER, please refer to the article 'Setting Multiple Broadcast Receiver' for setting.
Setting Multi-Broadcast Receiver
If you are using more than one Broadcast receiver create receiver class and your receiver class which you wish to add.
public class MultipleInstallReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { //Add AdbrixRemaster AbxReceiver abxReceiver = new AbxReceiver(); abxReceiver.onReceive(context,intent); // Add receiver that want receiver from com.android.vending.INSTALL_REFERRER } }
Add your Receiver Class on Androidmanifest.xml
<receiver android:name="myapp.packagename.MultipleInstallReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER"/> </intent-filter> </receiver>
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" ... > </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_remaster_app_key", "your_adbrix_remaster_secret_key"); if (Build.VERSION.SDK_INT >= 14) { registerActivityLifecycleCallbacks(new AbxActivityLifecycleCallbacks()); } } }
Additional SDK setup
Event uploading cycle setup
You can set the criteria for uploading cycle for events received on adbrix SDK to adbrix server.
Event upload cycle can be set by cumulative event counts and time frame.
* Events are uploaded based on the first out of two criteria.
* It is recommended to set in the activity class or application class in (a place / a part) which the app starts.
By cumulative event counts
Set event data to be uploaded to adbrix server when the preset counts of events are accumulated.
Use the following predefined values in the adbrix SDK.
- AdBrixRm.AdBrixEventUploadCountInterval.MIN : 10 counts
- AdBrixRm.AdBrixEventUploadCountInterval.NORMAL : 30 counts
- AdBrixRm.AdBrixEventUploadCountInterval.MAX : 60 counts
public class LauncherActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_launcher); // Event uploading cycle setting : Upload event to adbrix server when 10 cumulative events are counted AdBrixRm.setEventUploadCountInterval(AdBrixRm.AdBrixEventUploadCountInterval.MIN); } }
Event upload timer
Set event data to be uploaded to adbrix server after the preset time has elapsed.
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); // Event uploading cycle setting : Upload event to adbrix server every 120 seconds AdBrixRm.setEventUploadTimeInterval(AdBrixRm.AdBrixEventUploadTimeInterval.MAX); } }
GDPR
GDPR event can delete all of the user data when this event called. After this event call, SDK will stop working. This event cannot be undone unless the users re-install the app after they delete the app.
void gdprForgetMeEvent() { AdBrixRm.gdprForgetMe(getApplicationContext()); }
Deeplink and DefferdDeeplink
Deeplink
1. If deeplink landing activity is using android:launchMode="singleTask"
You can analyze app-open event via 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); } }
* Note: All the functions of onNewIntent(), setIntent(), deeplinkEvent() should be set in the same order as above.
Deep link setting is required to enable app open via 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 deeplink landing activity is not using android:launchMod"singleTask, you must set deeplink activity which adbrix provide on Androidmanifest.xml
<activity android:name="com.igaworks.v2.core.application.AbxDefaultDeeplinkActivity" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" 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" /> <!--Add your deeplink scheme and host --> <data android:scheme="your_scheme" android:host="your_host" /> </intent-filter>
<!-- After deepplink action is complete add activity which you wish to redirect" --> <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 with String after the user installs the app with tracking link.
example : yourscheme://your_custom_path
1. Using a Custom Application Class
If your app is using a Custom Application Class add DeferredDeeplink api using this method.
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); } }
2. Using AdbrixRM Application Class
If your app is using adbrix Application Class integrate 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); 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); } }
[[인용:위험:작게]]- onReceiveDeferredDeeplink won't have value if there is no deeplink info.
- When user installs the app from Google Play, Google Play store will send Deferred deeplink info as well as from adbrix Server. So it may open the view twice. Please make sure view don't open twice.
App Event Analysis
By using adbrix SDK, you can analyze the in-app events and create in-app event reports from 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 Analysis
- General Analysis
- Signup
- App update
- User invitation
- Use in-app credit
- In-Purchase
- Commerce 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 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 login is successful, send user ID like "user_1234" AdBrixRm.login("user_1234"); }else{ // When logout is successful, 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() { // Age AdBrixRm.setAge(30); // Gender AdBrixRm.setGender(AdBrixRm.AbxGender.MALE); // Other user properties AdBrixRm.UserProperties userProperties = new AdBrixRm.UserProperties(); 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 no more than 100 data.
2. The data type of Key is String and can use no more than 256 letters with Lowercase alphabetic characters and number only.
3. The Value data only be used no more then 1024byte.
Location Data
You can analyze location data if you can gather geographic information.
void locationUpdate() { // Update latitude longitude data AdBrixRm.setEnableLocationListening(true); }
* To receive geographic information, you need to add the permission of android.permission.ACCESS_COARSE_LOCATION
to [AndroidManifest > manifest].
Custom Event
All general in-app events except purchase related events can be analyzed.
You can analyze most of in-app user actions such as 'Button click', 'Character creation', 'Tutorial completion', 'Level achievement', and so on.
void userCustomEvent() { // Addtional event parameter AdBrixRm.AttrModel eventAttr = new AdBrixRm.AttrModel() .setAttrs("address","New York") .setAttrs("age", 27) .setAttrs("firsttime",true); // Click a button "Invite a friend" AdBrixRm.event("invite_button_click", eventAttr); // Complete "Character creation" AdBrixRm.event("create_character_complete",eventAttr); // Complete "Tutorial view" AdBrixRm.event("tutorial_complete", eventAttr); // Achieve "Level 10" AdBrixRm.event("level_10", eventAttr); }
※ Warning
If you set up a custom event name as almost every situation like the following example, this will create tons of event.
AdBrixRm.event("custom:Lev-37 cleared,clearTime:00:00:39.2343535");
So please use 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 event.
void userRegister() { try { // Registered user information AdBrixRm.AttrModel commonAttr = new AdBrixRm.AttrModel() .setAttrs("user_id", "user1234") .setAttrs("gender", "male") .setAttrs("age", 36) .setAttrs("married", true); AdBrixRm.CommonProperties.SignUp signupUserInfo = new AdBrixRm.CommonProperties.SignUp() .setAttrModel(commonAttr); //Call registration API AdBrixRm.Common.signUp(AdBrixRm.CommonSignUpChannel.Google,signupUserInfo); } catch (JSONException e) { e.printStackTrace(); } }
App Update
You can analyze app update event.
void appUpdate() { try { // App update information AdBrixRm.AttrModel commonAttr = 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(commonAttr); //Call app update API AdBrixRm.Common.appUpdate(updateInfo); } catch (JSONException e){ e.printStackTrace(); } }
User Invitation
You can analyze in-app user invitation event.
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(); } }
Credit Usage
You can analyze event 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(); } }
Payment
You can analyze in-app payment/ purchase event.
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(); } }
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(){ // Analyze the event that users view home/ main page AdBrixRm.Commerce.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); }
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();; } }
Add to Cart
You can analyze the event that users add products to 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(); } }
Add to Wishlist
You can analyze the event that users add products to 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
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); // 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(); } }
View an Order
You can analyze the event that users view an 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(); } }
Cancel an Order / Refund
You can analyze the event that users cancel an order or claim 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(); } }
Search a Product
You can analyze the event that users search a product
The following product-related data included in 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); }
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); }
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); }
View a Cart
You can analyze the event that users view cart.
The following data of 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); }
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); }
Gaming Event Analytics
You can analyze in-app events related to 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 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 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); //Call tutorial completion event AdBrixRm.Game.tutorialComplete(gameProperties); }
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); //Call character creation event AdBrixRm.Game.characterCreated(gameProperties); }
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); //Call stage clear event AdBrixRm.Game.stageCleared(gameProperties); }
Level Achieved
You can analyze the in-app event that users achieved 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); //Call level achieved event AdBrixRm.Game.levelAchieved(gameProperties); }
Comments
1 comment
vdj fzhi btur
Article is closed for comments.