DFINERY Integration [React Native]
Follow
Note
New Architecture that currently support on React-Native 0.68.0, are not supported on AdBrix SDK for React-Native. We currently on the devlopment, we will announce shotly after finishing the development.
Quick Start
SDK Download
You can download Adbrix SDK using npm.
npm install react-native-adbrix-remaster --save
SDK Updated
You can update the latest version of Adbrix SDK using npm. (current version : 2.1.0)
npm update react-native-adbrix-remaster --save
Overview of adbrix RN Plugin Integration Process
i) Step 1: Link with native projects:
Starting from RN v0.60, Adbrix RN plugin uses autolinking. You can skip this step. If React Native version <= 0.59, use this command: $ react-native link react-native-adbrix-remaster
If your project doesn’t support the react-native link command, please reference the example app on Adbrix RN Repository for the manual link process.
ii) Step 2: Platform Setup (both Android and iOS) See the guide below.
iii) Step 3: Then run the following:
iOS
$ cd ios && pod install
$ npx react-native run-ios
Android
$ npx react-native run-android
Platform Setup
AdbrixRm Plugin requires a platform set-up on both Android and iOS.
Android
[[인용:안내:보통]] We recommend using Android Studio for setting for Android platform.
1. Add the following dependencies to [build.gradle (Project: ProjectName)]
allprojects {
repositories {
google()
mavenCentral()
}
}
2. app/android/setting.gradle 에 SDK 를 선언합니다.
include(":react-native-adbrix-remaster") project(':react-native-adbrix-remaster').projectDir = file('../node_modules/react-native-adbrix-remaster/android')
3. Add following dependencies to [app:build.gradle]
In this example, we are going to use native android sdk v2.3.1.9
dependencies { implementation project(':react-native-adbrix-remaster') implementation "com.google.android.gms:play-services-ads-identifier:18.0.1" implementation "com.android.installreferrer:installreferrer:2.2" implementation "io.dfinery:android-sdk:+" }
[[인용:위험:보통]]* 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
4. Set required permissions on AndroidManifest.xml.
<manifest> ... <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" /> ... </manifest>
5. If your app use progurad, please add this code on app / proguard-rule.pro
# Add any project specific keep options here:
-keep class com.google.android.gms.common.ConnectionResult {
int SUCCESS;
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
java.lang.String getId();
boolean isLimitAdTrackingEnabled();
}
-keep public class com.android.installreferrer.** { *; }
6. Initialize native code: Open your MainApplication class, add this code (Deprecated on 2.3.0 ~)
Import statement:
import com.igaworks.v2.core.application.AbxActivityHelper;
import com.igaworks.v2.core.application.AbxActivityLifecycleCallbacks;
import android.os.Build;
Init code:
@Override
public void onCreate() {
super.onCreate();
AbxActivityHelper.initializeSdk(MainApplication.this, "app_key", "Secret_key");
}
Android (2.3.0 ~)
New method of SDK initialize has been changed starting on AdBrix SDK for React-Native AdBrix vesion 2.3.0. If you update SDK with new version please change SDK initialize method.
1. AndroidnManfiest.xml 에 Add AdBrixRmAppkey / AdBrixRmSecretKey meta data on AndroidManifest.xml.
<application>
<meta-data android:name="AdBrixRmAppKey" android:value="your_adbrix_remastered_app_key" />
<meta-data android:name="AdBrixRmSecretKey" android:value="your_adbrix_remastered_secret_key" /> </application>
2. Extend your Application class with AbxReactApplication class. and add "initReactNativeHost" to use AdBrix Package
public class MainApplication extends AbxReactApplication { @Override public void onCreate() { super.onCreate(); } @Override public ReactNativeHost initReactNativeHost() { return new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { List<ReactPackage> packages = new PackageList(this).getPackages(); // 1. Add AdbrixPackage packages.add(new AdbrixPackage(new AdbrixPackage.ReactApplicationContextListener() { @Override public void onReceive(ReactApplicationContext ReactApplicationContext) { // 2. Setting applicationContext setReactApplicationContext(ReactApplicationContext); } })); // Optional : Add Addtional package as you nedded. // example : LottiePackage // package.add (new LottiePackage()); return packages; } @Override protected String getJSMainModuleName() { // Need to add code here as you needed return "index"; } }; } // 3. Add Method for DFINERY SDK Listener @Override public void registerListener() { // Add Listener to use in DFINERY // setLogListener(); // setDeeplinkListener(); // setDeferredDeeplinkListener(); // setInAppMessageClickListener(); // setDfnInAppMessageAutoFetchListener(); // setRemotePushMessageListener(); // setLocalPushMessageListener(); } }
If you are using Multidex, add additional code for Multidex.
public class MainApplication extends AbxReactApplication{ // Add MultiDex Configuration @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } . . . }
iOS
1. Install the framework via Cocoapods in iOS
$ cd ios
$ pod install
※ If you don't have Cocoapods on mac, please install Cocoapods.
$ sudo gem install cocoapods
2. Open your Xcode project. go to [General > Linked Frameworks and Libraries] and add iAd.framework (for Apple Search Ads campaign), AdSupport.framework (collect IDFA) and you should consider using AppTrackingTransparency.framework for app to get user permission to collect IDFA.
If you target iOS 14.2 and use AdServices.framework, you need to set up the status of AdServices.framwork as Optional
(Important, default value is "Required". This is Apple's issue. App may crash at run-time with iOS before 14.2. So, you need to change status from "Required" to "Optional").
Go to [Build Phases > Link Binary With Libraries] and set the status.
When using AppTrackingTransparency.framework, the app's Info.plist must contain an NSUserTrackingUsageDescription key with a string value explaining to the user how the app uses this data. Reference Apple Document here. You need to enter a value for key "Privacy - Tracking Usage Description"
Result:
3. Because Adbrix iOS SDK is written in Swift, you have to include Swift Standard Library in your app. Go to [Build Settings > Always Embed Swift Standard Libraries]
4) Initialize native code: Add this code in your AppDelegate.m
Import statement
#import <AdSupport/AdSupport.h>
#import <AdBrixRmKit/AdBrixRmKit-swift.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>
Init code:
// Initialization code
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
[adBrix initAdBrixWithAppKey:@"adbrix_app_key" secretKey:@"adbrix_secret_key"];
return YES;
}
5) If you need IDFA, Please add "applicationDidBecomeActive" method and add ATT popup API. Please add AdBrix SDK API to use IDFA on ATT popup API.
#import <AdSupport/AdSupport.h> #import <AdBrixRmKit/AdBrixRmKit-swift.h> #import <AppTrackingTransparency/AppTrackingTransparency.h> @interface AppDelegate () @end @implementation AppDelegate . . . - (void)applicationDidBecomeActive:(UIApplication *)application { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; if (@available(iOS 14, *)) { [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { switch (status) { case ATTrackingManagerAuthorizationStatusAuthorized: [adBrix startGettingIDFA]; break; case ATTrackingManagerAuthorizationStatusDenied: [adBrix stopGettingIDFA]; break; case ATTrackingManagerAuthorizationStatusRestricted: [adBrix stopGettingIDFA]; break; case ATTrackingManagerAuthorizationStatusNotDetermined: [adBrix stopGettingIDFA]; break; default: [adBrix stopGettingIDFA]; break; } }]; } }
[[인용:안내:보통]]What is AppKey & SecretKey???
AppKey and SecretKey is an identification value for each value. You must have these values for integrating AdbrixRm SDK. You can found AppKey, SecretKey on AdbrixRm Console.
[[인용:안내:보통]] Congratulations!!!
Basic integration for AdbrixRm SDK is completed.
Now you can analyze the following function on your App
1. DAU, MAU, Daily Retention Reporting
2. App installation campaign like NCPI.
If you wish to analyze like in-app-purchase or in-app-action please keep following this guide
Additional SDK setup
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.UPLOAD_COUNT_INTERVAL_MIN : 10 counts
- AdbrixRm.UPLOAD_COUNT_INTERVAL_NORMAL: 30 counts
- AdbrixRm.UPLOAD_COUNT_INTERVAL_MAX : 60 counts
useEffect(() => {
AdbrixRm.setEventUploadCountInterval(AdbrixRm.UPLOAD_COUNT_INTERVAL_NORMAL);
}, []);
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.UPLOAD_TIME_INTERVAL_MIN: 10 counts
- AdbrixRm.UPLOAD_TIME_INTERVAL_NORMAL : 30 counts
- AdbrixRm.UPLOAD_TIME_INTERVAL_MAX : 60 counts
useEffect(() => {
AdbrixRm.setEventUploadTimeInterval(AdbrixRm.UPLOAD_TIME_INTERVAL_NORMAL);
}, []);
Deeplink and Deferred Deeplink
From version 2, AdbrixRm.setDeeplinkListener function is depreciated. Deeplink processing code should be implemented on the native side and use React Native Linking API to get deeplink information.
Deeplink setup for each platform (Android, iOS)
To use deeplink on Android or iOS, each platform requires a setup for the deeplink URL.
Android
To set deeplink, add this code on Androidmanifest.xml. You must add this code to the activity using MAIN/LAUNCHER. Activity’s launch mode should be android:launchMode="singleTask"
<intent-filter>
<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"/>
</intent-filter>
You can see the Sample manifest file in Example project.
Necessary import statement:
import android.content.Intent;
import android.os.Bundle;
import com.igaworks.v2.core.AdBrixRm;
Add this code on your Main Activity for deeplink conversion tracking:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
onNewIntent(MainActivity.this.getIntent());
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
AdBrixRm.deeplinkEvent(MainActivity.this);
}
iOS
Open your Xcode project and go to [General > Target > Info > URL Types] and add URL Scheme.
Add this code deepLinkOpenWithUrl
: on AppDelegate.m for deeplink conversion tracking.
Necessary import statement:
#import <React/RCTLinkingManager.h>
Tracking code:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
[adBrix deepLinkOpenWithUrl:url];
return [RCTLinkingManager application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
if ([userActivity.activityType isEqualToString: NSUserActivityTypeBrowsingWeb]) {
NSURL *incomeingurl = userActivity.webpageURL;
NSLog(@"DEEPLINK :: UniversialLink was Clicked!! : %@", incomeingurl);
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
[adBrix deepLinkOpenWithUrl:incomeingurl];
}
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
Receive Deeplink
To receive deeplink, you will use Linking API from React Native. Sample code:
const handleDeepLink = (e) => {
// Process deeplink here
};
useEffect(() => {
Linking.addEventListener('url', handleDeepLink);
Linking.getInitialURL().then(url => {
if (url) {
handleDeepLink({url});
}
});
return () => {
// Anything in here is fired on component unmount.
Linking.removeEventListener('url', handleDeepLink);
};
}, []);
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
useEffect(() => { AdbrixRm.setDeferredDeeplinkListener(function (deeplink) { console.log("deeplink msg arrived!"); console.log(deeplink); // you will receive DeferredDeeplink info on "deeplink" }); }, []);
[[인용:위험:작게]]- When a 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 doesn'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.
onPress={() => { // LogIn AdbrixRm.login("your_user_id"); }}
User Properties
You can analyze user properties such as age, gender, and others.
onPress={() => { // Age AdbrixRm.setAge(30); // Gender AdbrixRm.setGender(AdBrixRm.GENDER_MALE); // Other user properties var userProperties = new AdbrixRm.UserProperties(); userProperties.setProperty("user_nick", "peterPark"); userProperties.setProperty("place","Seoul"); userProperties.setProperty("height",180); userProperties.setProperty("married",false); AdbrixRm.setUserProperties(userProperties); }}
[[인용:위험:보통]]Constraints of userProperty 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.
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.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York") eventAttr.setAttrs("age", 27) eventAttr.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 var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("level",37); eventAttr.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.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); AdbrixRm.commonSignUp (AdbrixRm.SIGNUP_CHANNEL_KAKAO,eventAttr); }}
App Update
You can analyze app update event.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); AdbrixRm.commonAppUpdate("1.0.0","1.0.1",eventAttr); }}
User Invitation
You can analyze in-app user invitation event.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); AdbrixRm.commonInvite(AdbrixRm.INVITE_CHANNEL_KAKAO,eventAttr); }}
Credit Usage
You can analyze event for the usage of cashable credit.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); eventAttr.setAttrs("credit", 10000); AdbrixRm.commonUseCredit(eventAttr); }}
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 : (optional) Product Details and Options
- delivery charge : (optional) Delivery Charge
- payment method : (optional) Payment Method
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); var category2 = new AdbrixRm.CategoryModel(); category2.setCategory("electronic"); category2.setCategory("small"); category2.setCategory("samsung"); category2.setCategory("phone"); category2.setCategory("galaxybrand"); var product2 = new AdbrixRm.ProductModel(); product2.setProductId("12324"); product2.setProductName("Galaxy S10"); product2.setPrice(50000); product2.setDiscount(10000); product2.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product2.setCategory(category2); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); productList.setProduct(product2); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //purchase API AdbrixRm.commonPurchase("OrderID_12341",productList,0.00,3500.00,AdbrixRm.PAYMENT_METHOD_BANK_TRASNFER,eventAttr); }}
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.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York") eventAttr.setAttrs("age", 27) eventAttr.setAttrs("firsttime",true); AdbrixRm.commerceViewHome(eventAttr); }}
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 : (optional) Product Details and Options
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //CategoryView API AdbrixRm.commerceCategoryView(category1,productList,eventAttr); }}
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 : (optional) Product Details and Options
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //ProductView API AdbrixRm.commerceProductView(product1,eventAttr); }}
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 : (optional) Product Details and Options
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); var category2 = new AdbrixRm.CategoryModel(); category2.setCategory("electronic"); category2.setCategory("small"); category2.setCategory("samsung"); category2.setCategory("phone"); category2.setCategory("galaxybrand"); var product2 = new AdbrixRm.ProductModel(); product2.setProductId("12324"); product2.setProductName("Galaxy S10"); product2.setPrice(50000); product2.setDiscount(10000); product2.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product2.setCategory(category2); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); productList.setProduct(product2); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //AddToCart API AdbrixRm.commerceAddToCart(productList,eventAttr); }}
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 : (optional) Product Details and Options
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //AddToWishList API AdbrixRm.commerceAddToWishList(product1,eventAttr); }}
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 : (optional) Product Details and Options
- delivery charge : (optional) Delivery Charge
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); var category2 = new AdbrixRm.CategoryModel(); category2.setCategory("electronic"); category2.setCategory("small"); category2.setCategory("samsung"); category2.setCategory("phone"); category2.setCategory("galaxybrand"); var product2 = new AdbrixRm.ProductModel(); product2.setProductId("12324"); product2.setProductName("Galaxy S10"); product2.setPrice(50000); product2.setDiscount(10000); product2.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product2.setCategory(category2); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); productList.setProduct(product2); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //ReviewOrder API AdbrixRm.commerceReviewOrder("OrderID_12341",productList,0.10,3500.00,eventAttr); }}
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 : (optional) Product Details and Options
- penalty charge : (optional) Fee for the Cancelation/ Refund
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); var category2 = new AdbrixRm.CategoryModel(); category2.setCategory("electronic"); category2.setCategory("small"); category2.setCategory("samsung"); category2.setCategory("phone"); category2.setCategory("galaxybrand"); var product2 = new AdbrixRm.ProductModel(); product2.setProductId("12324"); product2.setProductName("Galaxy S10"); product2.setPrice(50000); product2.setDiscount(10000); product2.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product2.setCategory(category2); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); productList.setProduct(product2); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //Refund API AdbrixRm.commerceRefund("OrderID_12341",productList,2500.00,eventAttr); }}
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
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); var category2 = new AdbrixRm.CategoryModel(); category2.setCategory("electronic"); category2.setCategory("small"); category2.setCategory("samsung"); category2.setCategory("phone"); category2.setCategory("galaxybrand"); var product2 = new AdbrixRm.ProductModel(); product2.setProductId("12324"); product2.setProductName("Galaxy S10"); product2.setPrice(50000); product2.setDiscount(10000); product2.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product2.setCategory(category2); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); productList.setProduct(product2); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //Search API AdbrixRm.commerceSearch("your_key_word",productList,eventAttr); }}
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 : (optional) Product Details and Options
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //Share API AdbrixRm.commerceShare(AdbrixRm.SHARING_CHANNEL_KAKAO,product1,eventAttr); }}
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 : (optional) Product Details and Options
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); var category2 = new AdbrixRm.CategoryModel(); category2.setCategory("electronic"); category2.setCategory("small"); category2.setCategory("samsung"); category2.setCategory("phone"); category2.setCategory("galaxybrand"); var product2 = new AdbrixRm.ProductModel(); product2.setProductId("12324"); product2.setProductName("Galaxy S10"); product2.setPrice(50000); product2.setDiscount(10000); product2.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product2.setCategory(category2); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); productList.setProduct(product2); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //ListView API AdbrixRm.commerceListView(productList,eventAttr); }}
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 : (optional) Product Details and Options
onPress={() => { // product and category setup (can be set maximum 5 categories) var category1 = new AdbrixRm.CategoryModel(); category1.setCategory("cloth"); category1.setCategory("panth"); category1.setCategory("short"); category1.setCategory("summer"); category1.setCategory("Nike"); var product1 = new AdbrixRm.ProductModel(); product1.setProductId("3029102"); product1.setProductName("Gray top"); product1.setPrice(50000); product1.setDiscount(10000); product1.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product1.setCategory(category1); var category2 = new AdbrixRm.CategoryModel(); category2.setCategory("electronic"); category2.setCategory("small"); category2.setCategory("samsung"); category2.setCategory("phone"); category2.setCategory("galaxybrand"); var product2 = new AdbrixRm.ProductModel(); product2.setProductId("12324"); product2.setProductName("Galaxy S10"); product2.setPrice(50000); product2.setDiscount(10000); product2.setCurreny(AdbrixRm.CURRENCY_KR_KRW); product2.setCategory(category2); // productlist setup var productList = new AdbrixRm.ProductModelList(); productList.setProduct(product1); productList.setProduct(product2); // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); //CartView API AdbrixRm.commerceCartView(productList,eventAttr); }}
Fill in Payment Information
You can analyze the event that users fill in payment information.
onPress={() => {
var commmerceAttr = new AdbrixRm.AttrModel(); commmerceAttr.setAttrs("grade", "vip"); commmerceAttr.setAttrs("howmany_buy", 36); commmerceAttr.setAttrs("card", "kbcard"); commmerceAttr.setAttrs("discount", true); //Event of filling in payment information AdbrixRm.commercePaymentInfoAdded(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 .
- isSkip : (required) Check whether the completion is done with skip button.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); eventAttr.setAttrs("credit", 10000); AdbrixRm.gameTutorialCompleted(true,eventAttr); }}
Character Creation
You can analyze the in-app event that users create characters.
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); eventAttr.setAttrs("credit", 10000); eventAttr.setAttrs("name","AngryNelsson316"); AdbrixRm.gameCharacterCreated(eventAttr); }}
Stage Cleared
You can analyze the in-app event that users clear stages.
- stageName : (required) Name of Cleared Stage
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); eventAttr.setAttrs("credit", 10000); AdbrixRm.gameStageCleared("stage1-1",eventAttr); }}
Level Achieved
You can analyze the in-app event that users achieved certain levels.
- level : (required) Level Achieved (1~10000)
onPress={() => { // Addtional event parameter var eventAttr = new AdbrixRm.AttrModel(); eventAttr.setAttrs("address","New York"); eventAttr.setAttrs("age", 27); eventAttr.setAttrs("firsttime",true); eventAttr.setAttrs("credit", 10000); AdbrixRm.gameLevelAchieved(25,eventAttr); }}