Adbrix Integration [iOS Unity]
Theo dõiQuick Start
Download SDK
adbrix Remastered Unity Package : [다운로드(update : 2020/06/03]
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 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 guide will explain only the ios platform.
Setting Plugin Initializing
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(); } void OnApplicationPause(bool pauseStatus) { if (pauseStatus) { Debug.Log("go to Background"); AdBrixRM.endSession(); } else{ Debug.Log("go to Foreground"); AdBrixRM.startSession(); } } }
Apple IDFA Setup
To use adbrix bution SDK require Apple IDFA.
Please set IDFA at first start script [Void start()]
using UnityEngine; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System; using UnityEngine.iOS; using AdBrixRmIOS; public class AdBrixRmSample_iOS : MonoBehaviour { void Start () { AdBrixRm.setAppleAdvertisingIdentifier(Device.advertisingIdentifier); } }
AppKey & SecretKey setup
Set the adbrix AppKey and SecretKey issued from adbrix Homepage.
using UnityEngine; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System; using UnityEngine.iOS; using AdBrixRmIOS; public class AdBrixRmSample_iOS : MonoBehaviour { void Start () { AdBrixRm.initAdBrix("appKey", "secretKey"); } }
* AppKey is different from adbrix Classic and adbrix Remaster.
* adbrix Remaster AppKey and SecretKey can be used on both Android and iOS platform.
Xcode project setup
After finishing the build on Unity, open the Xcode project. Xcode project will look like following screenshot.
Please change these option
- Swift Library setup
Build Settings -> Always Embed Swift Standard Libraries as "YES"
- Check the framework
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 setup
Custom Url Scheme setting
Open the Xcode project after finishing Unity build
Move to [General > Target > Info > URL Types] and add URL Scheme
Deeplink Open Event Handler Script
Add Deeplink handler on deeplink script.
public class AdBrixRmSample_IOS : MonoBehaviour {
void Awake () {
AdBrixRm.didReceiveDeeplink += HandleDidReceiveDeeplink;
}
void Start () {
AdBrixRm.SetCallbackHandler("AOS_SampleObject");
// Set this to the name of your linked GameObject
}
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
Deeplink open event
Add two codes on UnityAppController.mm
1. Add Header
#include <AdBrixRm/AdBrixRM-Swift.h>
2. Add following code on (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation delegate
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation { //생략 AdBrixRM *adBrix = [AdBrixRM sharedInstance]; [adBrix deepLinkOpenWithUrl:url]; return YES; }
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 when 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.
void sampleFunction() { if(isLoginSuccess) { // When login is successful, send user ID like "user_1234" AdBrixRm.login ("user_1234"); } }
* 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() { // Location info (lat, lon) 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.