Adbrix Integration [Android Unity]
Theo dõiQuick Start
Download SDK
AdBrix Remastered Unity Package : [Download]
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.
Install Google Play Service Library
To run AdBrix SDK, you need to install ‘Google play Service Library’. You can download the library from this link.
Google Play Service Library : [Download]
Library list
- play-services-basement-15.0.0.aar
- play-services-ads-identifier-15.0.0.aar
- support-compat-24.2.0.aar
Please add this library on Assets -> Plugins -> Android folder.
[[인용:위험:작게]] ※ Warning : If you are using newer version please use that version.
iOS / Android Integration
If your Unity project runs both iOS and Android you need to add 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.
AdBrix SDK init
To use AdBrix SDK add these script on your Awake().
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Runtime.InteropServices; using System; using AdBrixRmAOS; public class AdBrixRmSample_AOS : MonoBehaviour { void Awake() { AdBrixRm.InitPlugin(); } }
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>
Android Entry point Activity setup
Adbrix provides entry point activity that replaces the UnityPlayerActivity. You can use this activity depending on your development environment.
1. Using Adbrix Activity as an Entry point
If you don't use UnityPlayerActivity , please replace <activity android:name = ".UnityPlayerAcitivty to "com.igaworks.v2.core.unity.AbxUnityPlugin" .
<activity android:name="com.igaworks.v2.core.unity.AbxUnityPlugin" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" android:noHistory="true" tools:node="replace"> <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" /> </intent-filter> </activity>
2. Using UnityPlayerAcitvity as an Entry point
If you use UnityPlayerAcitivy as an Entry point, export your project to Android Studio and add the following code to UnityPlayerActivity.java class.
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ... onNewIntent(UnityPlayerActivity.this.getIntent()); } @Override protected void onNewIntent(Intent intent) { // To support deep linking, we need to make sure that the client can get access to // the last sent intent. The clients access this through a JNI api that allows them // to get the intent set on launch. To update that after launch we have to manually // replace the intent with the one caught here. // Add Adbrix Unity API AbxUnityPlugin.startAdbrixRmSDK(intent); }
[[인용:위험:작게]] - If you use custom activity other then UnityPlayerActivity as an Entry point, do use this code as well.
After that add these code on Androidmanifest.xml (If this activity has other function, please delete it)
<activity android:name="com.igaworks.v2.core.unity.AbxUnityPlugin" />
Additional SDK setup
Set up Log Level
Set up the level of output logs of adbrix SDK.
The log level consists of a total of 6 levels including level 1 of non-output, and levels 2 to 6 are configured as the upper level includes all lower level logs.
- AdBrixRM.AdBrixLogLevel.NONE : No output logs.
- AdBrixRM.AdBrixLogLevel.TRACE : Output logs of general development level.
- AdBrixRM.AdBrixLogLevel.DEBUG : Output logs of development levels that contain TRACE.TRACE for debugging purpose.
- AdBrixRM.AdBrixLogLevel.INFO : Output logs of import development levels that contain TRACE, DEBUG를 for data storage, loading, sending, and more.
- AdBrixRM.AdBrixLogLevel.WARNING : Output logs of development levels that does not contain fatal issue like Exception but problematic issues to handle data like TRACE, DEBUG, INFO.
- AdBrixRM.AdBrixLogLevel.ERROR : Output logs of development levels that contain fatal issue like Exception, including TRACE, DEBUG, INFO, and WARNING.
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.setLogLevel(AdBrixRm.AdBrixLogLevel.ERROR); } }
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.
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
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); } }
By time frame
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 : 30초
- AdBrixRM.AdBrixEventUploadTimeInteval.NORMAL :60초
- AdBrixRM.AdBrixEventUploadTimeInteval.MAX :120초
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 user re-install the app after delete app.
void gdprForgetMeEvent() { AdBrixRm.gdprForgetMe (); }
Start from Sample Project
The adbrix Unity package file includes a sample project along with the SDK.
To see the sample source, check the scene_sample.unity file and AdBrixRmSample_AOS.cs file in the same location in the [Import Pop Up] screen above, which is in the same location as the below to see the sample source.
[ Check scene_sample.unity and AdBrixRmSample_AOS.cs File ]
Deeplink and Defferd Deeplink
Deeplink Setting
When using the default deep link activities provided by adbrix, configure the deep link in AndroidManifest.xml as follows.
<activity android:name="com.igaworks.v2.core.unity.AbxUnityPlugin" 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" /> <!--Input deeplink schema and host. --> <data android:scheme="adbrix" /> </intent-filter> <!-- Input the full package name of the main activity to redirect to the main activity after tracking the deep link." --> <meta-data android:name="AbxRedirectActivity" android:value="com.exampleunity.UnityPlayerActivity"/> </activity>
Add Deeplink handler on deeplink managing scrip.
public class AdBrixRmSample_AOS : MonoBehaviour { void Awake () { AdBrixRM.didReceiveDeeplink += HandleDidReceiveDeeplink; } void Start () { AdBrixRM.SetCallbackHandler("AOS_SampleObject"); // Object name must be add on thi parameter. } void OnDisable () { AdBrixRM.didReceiveDeeplink -= HandleDidReceiveDeeplink; } public void HandleDidReceiveDeeplink (string deepLinkValue){ Debug.Log("HandleDidReceiveDeeplink : "+ deepLinkValue); } }
SDK will send deeplink value on HandleDidReceiveDeeplink deepLinkValue. You can send certain view using this deeplink value.
[[인용:위험:작게]] ※ Example : If Adbrix tracking link have "adbrixrm://deeplinkpath" deeplink value
HandleDidReceiveDeeplink : adbrixrm://deeplinkpath+addtional parameter
Deferred Deeplink setting
Deferred Deeplink can send the user to a certain view when the user installs the app.
To use Deferred Deeplink, add AdBrixRm script on object which receiving deeplink info.
Select Add Component click -> Scripts -> AdbrixRmAOS -> Ad Brix Rm script
Add Deeplink handler on deeplink managing scrip.
public class AdBrixRmSample_AOS : MonoBehaviour { void Awake () { AdBrixRM.didReceiveDeferredDeeplink += HandleDidReceiveDeferredDeeplink; } void Start () { AdBrixRM.SetCallbackHandler("AOS_SampleObject"); //Object name must be added on this parameter AdBrixRm.SetAdBrixDeferredDeeplinkDelegate(); } void OnDisable () { AdBrixRM.didReceiveDeferredDeeplink -= HandleDidReceiveDeferredDeeplink; } public void HandleDidReceiveDeferredDeeplink (string deferredDeepLinkValue){ Debug.Log("HandleDidReceiveDeferredDeeplink : "+ deferredDeepLinkValue); } }
SDK will send deeplink value on HandleDidReceiveDeferredDeeplink deferredDeepLinkValue. You can send certain view using this deeplink value.
[[인용:위험:작게]] ※ Example : If Adbrix tracking link have "adbrixrm://deeplinkpath" deeplink value
HandleDidReceiveDeferredDeeplink : adbrixrm://deeplinkpath
[[인용:위험:작게]] - HandleDidReceiveDeferredDeeplink 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 the view does not get opened twice.
App Event Analytics
Using Adbrix SDK, you can analyze In-app event and create In-app event report at 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 type 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 user ID (user defining parameter) as following.
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("nickname", "adbrixRM"); AdBrixRm.setUserProperties (dict); }
[[인용:위험:보통]]Constraints of user and event data using Dictionary
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.
User locatiopn
If you get user location, you can send to AdBrix for analysis.
void sampleFunction() { // 위도 경도 정보 업데이트 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 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 event.
void userSignup() { // Registered user information Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("nickname", "adbrixRM"); AdBrixRm.commonSignUp(AdBrixRm.SignUpChannel.Google, dict); }
App Update
You can analyze app update event.
void appUpdate() { // user information Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("nickname", "adbrixRM"); AdBrixRm.commonAppUdate("1.2.2a","1.3.0",dict); }
User Invitation
You can analyze in-app user invitation event.
void userInvite() { // user information Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("nickname", "adbrixRM"); AdBrixRm.commonSignUp(AdBrixRm.InviteChannel.Facebook, dict); }
Credit Usage
You can analyze event 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 event.
The following product and order related data are sent in the form of 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 json : (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 that users view home/ main page.
void sampleFunction() { AdBrixRm.commerceViewHome (); }
Category / Event Page View
You can analyze the event that users view category/ event page.
Category information can be analyzed down to maximum 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 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 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 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
- 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 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 cancelation 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 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 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.
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
- 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 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
- 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 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 and sent.
- (required) Check whether the completion is done with 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.
The following stage clear data is to be formed and sent.
- (required) Name of Cleared Stage
void sampleFunction() { AdBrixRm.gameStageCleared("1-1"); }
Level Achieved
You can analyze the in-app event that users achieved certain levels.
The following achieved level data is to be formed and sent.
- (required) Level Achieved (1~10000)
void sampleFunction() { AdBrixRm.gameLevelAchieved (15); }
Bình luận
0 bình luận
Vui lòng đăng nhập để viết bình luận.