DFINERY Integration [Unity - Android]
FollowQuick Start
Download SDK
DFINERY(AdBrix) Unity Package : [Download (Updated : 09/28/2022)]
Install Unity Package
1. Open the existing Unity project.
[Open existing Unity project]
2. Drag and drop *.package file to existing Unity project's Asset window.
[Drag & Drop AdBrix SDK package file ]
3. Unless the project is developed with iOS simultaneously, select only Android directory by unchecking iOS directory and import.
iOS / Android Integration
If your Unity project runs both iOS and Android you need to add a platform script for each OS.
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Runtime.InteropServices; using System; #if UNITY_IOS using UnityEngine.iOS; using AdBrixRmIOS; #elif UNITY_ANDROID using AdBrixRmAOS; #endif public class AdBrixRmSample_AOS : MonoBehaviour { }
[[인용:위험:작게]] ※ Warning: From now on, this guide will only explain the Android platform.
After creating the script, add your script to your component.
AdBrix SDK init
[[인용:위험:작게]] ※ This section requires you to export your project to Android Studio.
1. Using SDK's Application class
If you want to use DFINERY SDK's Application class (com.igaworks.v2.unity.BaseApplication) add this class name to [AndroidManifest.xml > application] section.
<application android:name="com.igaworks.v2.unity.BaseApplication" android:usesCleartextTraffic="true" android:label="@string/app_name" android:icon="@drawable/app_icon">
2. Using your own Application class
If you wish to use your own Application class please extend AbxUnityApplication class to your Application class.
package com.igaworks.v2.unity; public class MyApplication extends AbxUnityApplication{ @Override public void registerListener() { } }
Add your application class to AndroidManfiest.xml
<application android:name="com.your.packagename.MyApplication" android:usesCleartextTraffic="true" android:label="@string/app_name" android:icon="@drawable/app_icon">
Setting AppKey and SecretKey
Set the Adbrix AppKey and SecretKey issued from the AdBrix console.
Set the following at [AndroidManifest.xml > manifest > application]:
<application> ... <meta-data android:name="AdBrixRmAppKey" android:value="inputYourAppKey" /> <meta-data android:name="AdBrixRmSecretKey" android:value="inputYourSecretKey" /> ... </application>
Android Entry point Activity setup
DFINERY SDK requires replacing "UnityPlayerActivity" with SDK's own activity "com.igaworks.v2.unity.AbxUnityActivity". Please replace "UnityPlayerActivity" with "com.igaworks.v2.unity.AbxUnityActivity"
<activity android:name="com.igaworks.v2.unity.AbxUnityActivity" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullUser" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"> <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> </activity>
build.gradle
To use DFINERY SDK, please add an additional libraries to build.gradle dependencies section.
dependencies { implementation 'androidx.core:core:1.0.0' implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' implementation 'com.android.installreferrer:installreferrer:2.2' }
gradle.properties
Add this code to gradle.properties file in the Android project.
android.useAndroidX=true android.enableJetifier=true
Additional SDK setup
Event uploading cycle setup
You can set the criteria for the uploading cycles for events.
The event upload cycle can be set by the number of accumulative events and time.
* Events are uploaded based on the first out of two criteria.
Event counter
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 events
- AdBrixRm.AdBrixEventUploadCountInterval.NORMAL : 30 events
- AdBrixRm.AdBrixEventUploadCountInterval.MAX : 60 events
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Runtime.InteropServices; using System; using AdBrixRmAOS; public class AdBrixRmSample_AOS : MonoBehaviour { void Start () { AdBrixRm.setEventUploadCountInterval(AdBrixRm.AdBrixEventUploadCountInterval.NORMAL); } }
Event 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.AdBrixEventUploadTimeInteval.MIN: every 30 seconds
- AdBrixRM.AdBrixEventUploadTimeInteval.NORMAL: every 60 seconds
- AdBrixRM.AdBrixEventUploadTimeInteval.MAX: every 120 seconds
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Runtime.InteropServices; using System; using AdBrixRmAOS; public class AdBrixRmSample_AOS : MonoBehaviour { void Start () { AdBrixRm.setEventUploadTimeInterval(AdBrixRm.AdBrixEventUploadTimeInterval.NORMAL); } }
GDPR
GDPR event can delete all of the user data when this event is called. After this event call, SDK will stop working. This event cannot be undone unless the user reinstalls the app after deleting the app.
void gdprForgetMeEvent() { AdBrixRm.gdprForgetMe (); }
Deeplink and Deferred Deeplink
Deeplink Setting
Add deeplink handler on your script that controller the DFINERY API.
public class AdBrixSdkController: MonoBehaviour { public void HandleDidReceiveDeeplink (string deepLinkValue){ Debug.Log("HandleDidReceiveDeeplink : "+ deepLinkValue); } }
Export your project to Android Studio and add deeplink scheme/path on Android Studio.
<activity android:name="com.igaworks.v2.unity.AbxUnityActivity" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullUser" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"> <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <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_deeplink_scheme" android:host="your_deeplink_host" /> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> </activity>
Add your GameObjet name and Handler on your android project's Application class.
public class BaseApplication extends AbxUnityApplication{ public static String GAME_OBJECT_NAME = "AbxObject"; // Game Object name @Override public void registerListener() { registerAllListeners(); setGameObjectNameReceiveListener(new GameObjectNameReceiveListener() { @Override public void onReceive(String gameObjectName) { BaseApplication.GAME_OBJECT_NAME = gameObjectName; unregisterListenersForChangingGameObjectName(); registerAllListeners(); } }); } public void registerAllListeners(){ setDeeplinkListener(GAME_OBJECT_NAME, "HandleDidReceiveDeeplink"); // Add Deeplink handler } }
[[인용:위험:작게]] ※ GAME_OBJECT_NAME must be the same name that using on the Unity script's Game object.
Deferred Deeplink setting
Add a DeferredDeeplink handler on your script that controller the DFINERY SDK's API.
public class AdBrixSdkController: MonoBehaviour { public void HandleDidReceiveDeferredDeeplink (string deferredDeeplinkValue){ Debug.Log("HandleDidReceiveDeferredDeeplink : "+ deferredDeeplinkValue); } }
[[인용:위험:작게]] ※ Example: If Adbrix tracking link has "adbrixrm://deeplinkpath" deep link value,
HandleDidReceiveDeferredDeeplink will return "adbrixrm://deeplinkpath" as string
Add your GameObjet name and Handler on your android project's Application class.
public class BaseApplication extends AbxUnityApplication{ public static String GAME_OBJECT_NAME = "AbxObject"; // Game Object name @Override public void registerListener() { registerAllListeners(); setGameObjectNameReceiveListener(new GameObjectNameReceiveListener() { @Override public void onReceive(String gameObjectName) { BaseApplication.GAME_OBJECT_NAME = gameObjectName; unregisterListenersForChangingGameObjectName(); registerAllListeners(); } }); } public void registerAllListeners(){ setDeeplinkListener(GAME_OBJECT_NAME, "HandleDidReceiveDeferredDeeplink"); // Add deferred depplink handler } }
[[인용:위험:작게]] ※ GAME_OBJECT_NAME must be the same name that using on the Unity script's Game object.
[[인용:위험:작게]] - HandleDidReceiveDeferredDeeplink won't return any value if there is no deep link info
- When a user installs the app from Google Play, the Google Play store will send Deferred deep link info as well as from Adbrix Server. So it may open the view twice. Please make sure the view does not get opened twice.
App Event Analytics
Using Adbrix SDK, you can analyze in-app events and create In-app event reports at the AdBrix dashboard.
To analyze the In-app event, you must add ‘Adbrix Event API’ at the event points where the event is executed.
Adbrix SDK provides 5 different types of In-app event API
- User Analysis
- Login / Logout Event
- User information
- User location
- 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 the user ID (user defining parameter) as follows.
When logout is successful, initialize the user login data by passing an empty string such as "".
void sampleFunction() { if(isLoginSuccess) { // When login is successful, send user ID like "user_1234" AdBrixRm.login ("user_1234"); } else { // When logout is successful, send empty string "" AdBrixRm.login (""); } }
* 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 sampleFunction() { //Age AdBrixRm.setAge (20); //Gender AdBrixRm.setGender(AdBrixRm.Gender.FEMALE); //Other user properties Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("key1", "value1"); AdBrixRm.setUserProperties (dict); }
[[인용:위험:보통]]Regulations of user and event data using Dictionary
1. You can send up to 100 data.
2. The data type of Key should be String and up to 256 letters with lowercase alphabetic characters and numbers only.
3. The Value data can be up to 1024byte.
User location
If you get the user location, you can send it to AdBrix for analysis.
void sampleFunction() { // update user location AdBrixRm.setLocationWithLatitude(39.00, 121.00); }
Custom Event Analytics
All general in-app events except purchase-related events can be analyzed.
You can analyze in-app user actions easily via an event (string).
void sampleFunction() { // Custom Event AdBrixRm.events ("event_name"); }
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 userSignup() { // Registered user information Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("key1", "value1"); AdBrixRm.commonSignUp(AdBrixRm.SignUpChannel.Google, dict); }
App Update
You can analyze app update events.
void appUpdate() { // user information Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("key1", "value1"); AdBrixRm.commonAppUdate("1.2.2a","1.3.0",dict); }
User Invitation
You can analyze in-app user invitation events.
void userInvite() { // user information Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("key1", "value1"); AdBrixRm.commonSignUp(AdBrixRm.InviteChannel.Facebook, dict); }
Credit Usage
You can analyze events for the usage of cashable credit.
void useCredit() { // Credit usage information Dictionary<string, string> credit_info= new Dictionary<string, string>(); credit_info.Add("credit", "20000"); AdBrixRm.commonSignUp(credit_info); }
Payment
You can analyze in-app payment/ purchase events.
The following product and order-related data are sent in the form of an array.
- 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 map: (optional) Product Details and Options
- delivery charge : (optional) Delivery Charge
- payment method : (optional) Payment Method
void sampleFunction() { //Arrange product list List<AdBrixRm.AdBrixRmCommerceProductModel> items = new List<AdBrixRm.AdBrixRmCommerceProductModel> (); //Create dictionary for product detail options Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create a product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRm.AdBrixCurrencyName(AdBrixRm.Currency.KR_KRW), AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); //Create a product AdBrixRm.AdBrixRmCommerceProductModel productModel2 = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId02", "productName02", 10000.00, 1, 5000.00, AdBrixRm.AdBrixCurrencyName(AdBrixRm.Currency.KR_KRW), AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); items.Add (productModel2); //Event for product purchase AdBrixRm.commonPurchase ("30290121", items, 1000.00, 3500.00, AdBrixRm.PaymentMethod.CREDIT_CARD); }
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 a product
- View cart
- Fill in payment information
Home/ Main Page View
You can analyze the event when users view the home/ main page.
void sampleFunction() { AdBrixRm.commerceViewHome (); }
Category / Event Page View
You can analyze the event when users view the category/ event page.
Category information can be analyzed down to a maximum of 5 levels.
void sampleFunction() { //Create product in the category AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Sale- Pants and Skirts"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); //Category view event AdBrixRm.commerceCategoryView (AdBrixRmCommerceProductCategoryModel.create("기획전"), items); }
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
- product attr map : (optional) Product Detail Option
void sampleFunction() { //Create dictionary for product detail option Dictionary<string, string> productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); //Product detail view AdBrixRm.commerceProductView (productModel); }
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
- product attr map : (optional) Product Detail Option
void sampleFunction() { //Arrange product list List<AdBrixRm.AdBrixRmCommerceProductModel> items = new List<AdBrixRm.AdBrixRmCommerceProductModel> (); //Create dictionary for product detail option Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRmCommerceProductModel productModel = AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); //Add to cart event AdBrixRm.commerceAddToCart(items); }
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
- product attr map : (optional) Product Detail Option
void sampleFunction() { //Create dictionary for product detail option Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); //Add to wishlist event AdBrixRm.commerceAddToWishList (productModel); }
View 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
- product attr map : (optional) Product Detail Option
- delivery charge : (optional) Delivery Charge
void sampleFunction() { //Arrange product list List<AdBrixRm.AdBrixRmCommerceProductModel> items = new List<AdBrixRm.AdBrixRmCommerceProductModel> (); //Create dictionary for product detail option Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); //View an order event AdBrixRm.commerceReviewOrder ("30290121", items, 1000.00, 3500.00); }
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
- product attr map : (optional) Product Detail Option
- penalty charge : (optional) Fee for the Cancelation/ Refund
void sampleFunction() { //Arrange product list List<AdBrixRm.AdBrixRmCommerceProductModel> items = new List<AdBrixRm.AdBrixRmCommerceProductModel> (); //Create dictionary for product detail option Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); //Order cancelling event AdBrixRm.commerceRefund ("30290121", items, 3500.00); }
Search a Product
You can analyze the event that users search a product
The following product-related data included in search results 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 sampleFunction() { //Arrange product list List<AdBrixRm.AdBrixRmCommerceProductModel> items = new List<AdBrixRm.AdBrixRmCommerceProductModel> (); //Create dictionary for product detail option Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); //Product search event AdBrixRm.commerceSearch(items, "Nike"); }
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
- product attr map : (optional) Product Detail Option
void sampleFunction() { //Create dictionary for product detail option Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); //Product sharing event AdBrixRm.commerceShare (AdBrixRm.SharingChannel.KAKAOTALK, productModel); }
View a Product List
You can analyze the event that users view a product list.
When a user views a product list, the following 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
- product attr map : (optional) Product Detail Option
void sampleFunction() { //Arrange product list List<AdBrixRm.AdBrixRmCommerceProductModel> items = new List<AdBrixRm.AdBrixRmCommerceProductModel> (); //Create dictionary for product detail option Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); //Product list viewing event AdBrixRm.commerceListView (items); }
View a Cart
You can analyze the event that users view the cart.
When a user views the cart, the following 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
- product attr map : (optional) Product Detail Option
void sampleFunction() { //Arrange product list List<AdBrixRmCommerceProductModel> items = new List<AdBrixRmCommerceProductModel> (); //Create dictionary for product detail view Dictionary<string, string>productAttrs = new Dictionary<string, string>(); productAttrs.Add ("Att1", "Value1"); productAttrs.Add ("Att2", "Value2"); productAttrs.Add ("Att3", "Value3"); //Create product AdBrixRm.AdBrixRmCommerceProductModel productModel = AdBrixRm.AdBrixRmCommerceProductModel.create ( "productId01", "productName01", 10000.00, 1, 5000.00, AdBrixRmAOS.AdBrixRm.Currency.KR_KRW, AdBrixRm.AdBrixRmCommerceProductCategoryModel.create ("Cate1", "Cate2", "Cate3"), AdBrixRm.AdBrixRmCommerceProductAttrModel.create (productAttrs) ); items.Add (productModel); //Cart viewing event AdBrixRm.commerceCartView (items); }
Fill in Payment Information
You can analyze the event that users fill in payment information.
void sampleFunction() { //Create dictionary for payment information detail option Dictionary<string, object> paymentAttrs = new Dictionary<string, object>(); paymentAttrs.Add ("creditcard", "oocard"); AdBrixRm.commercePaymentInfoAdded (paymentAttrs); }
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 and sent.
- (required) Check whether the completion is done with the skip button.
void sampleFunction() { AdBrixRm.gameTutorialCompleted (false); }
Character Creation
You can analyze the in-app event that users create characters.
void sampleFunction() { AdBrixRm.gameCharacterCreated(); }
Stage Cleared
You can analyze the in-app event that users clear stages.
A name of the cleared stage is mandatory.
- (required) Name of Cleared Stage
void sampleFunction() { AdBrixRm.gameStageCleared("1-1"); }
Level Achieved
You can analyze the in-app event that users achieved at certain levels.
The following achieved level data is to be formed and sent.
- (required) Level Achieved (1~10000)
void sampleFunction() { AdBrixRm.gameLevelAchieved (15); }