Adbrix Integration [React Native]
Follow
[[인용:위험:작게]] 18th Dec. 2020 Test with iOS Simulator not available
Currently, Adbrix SDK not working on iOS Simulator only on the ObjC project. We are working on dealing with this issue. So if you wish to run a test please use a real device.
Quick Start
SDK Download
You can download Adbrix SDK using npm.
npm install react-native-adbrix-remaster --save
Platform Setup
AdbrixRm SDK requires a platform setup on Android / iOS for running SDK.
Android
1. Add following dependencies to [app:build.gradle]
dependencies { implementation 'com.google.android.gms:play-services-ads:15.0.0' implementation 'com.android.installreferrer:installreferrer:1.0' }
[[인용:위험:보통]]* 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
2. Set required permissions on AndroidManifest.xml.
<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>
3. Set install a broadcast receiver on AndroidManifest.xml
<application> ... <receiver android:name="com.igaworks.v2.core.AbxReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver> ... </application>
※ If you using multi-broadcast Receiver create receiver class like the following example.
public class MultipleInstallReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { //Add AdbrixRemaster AbxReceiver abxReceiver = new AbxReceiver(); abxReceiver.onReceive(context,intent); // Add receiver that want receiver from com.android.vending.INSTALL_REFERRER } }
Add your Receiver Class on Androidmanifest.xml
<receiver android:name="myapp.packagename.MultipleInstallReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER"/> </intent-filter> </receiver>
4. To run SDK please add this code on app / proguard-rule.pro
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {*;} -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$* {*;}
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.
3. Go to [Build Settings > Always Embed Swift Standard Libraries]
SDK Initialization
Add startAdbrixSDK api on componentDidMount()
import AdbrixRm from 'react-native-adbrix-remaster'; componentDidMount(): void { AdbrixRm.startAdbrixSDK('your_app_key', 'your_secret_key'); }
[[인용:안내:보통]]What is AppKey & SecretKey???
AppKey and SecretKey is an identification value for each value. You must have these value 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
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
AdbrixRm.setEventUploadTimeInterval(AdbrixRm.UPLOAD_TIME_INTERVAL_NORMAL);
Deeplink and Deferred Deeplink
Deeplink
Add setDeeplinkListener API on componentDidMount(). using this API you will receive deeplink information to a string. using this information you can send the user to a certain view.
componentDidMount(): void { AdbrixRm.setDeeplinkListener(function (deeplink) { console.log("deeplink msg arrived!"); console.log(deeplink); // you will receive deeplink info on "deeplink" }); }
Deeplink setup for each platform
To use deeplink on Android or iOS, each platform requires setup for the deeplink URL.
Android
To set deeplink, add this code on Androidmanifest.xml. You must add this code on activity which using MAIN/LAUNCHER.
<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" android:host="your_host" /> </intent-filter>
iOS
Open your Xcode project and go to [General > Target > Info > URL Types] and add URL Scheme.
Add this code on AppDelegate.m
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { // AdBrixRM instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Deeplink tracking code [adBrix deepLinkOpenWithUrl:url]; return YES; }
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
componentDidMount(): void { AdbrixRm.setDeferredDeeplinkListener(function (deeplink) { console.log("deeplink msg arrived!"); console.log(deeplink); // you will receive DeferredDeeplink info on "deeplink" }); }
[[인용:위험:작게]]- When user installs the app from Google Play, Google Play store will send Deferred deeplink info as well as from adbrix Server. So it may open the view twice. Please make sure view don't open twice.
App Event Analysis
By using adbrix SDK, you can analyze the in-app events and create in-app event reports from adbrix dashboard.
To analyze the in-app event, you must add adbrix event API for the point where the event is executed.
The adbrix SDK provides five different types of in-app event APIs.
- User Analysis
- Login / Logout Event
- User information
- Location information
- Custom Analysis
- General Analysis
- Signup
- App update
- User invitation
- Use in-app credit
- In-Purchase
- Commerce Analysis
- Home view
- Category view
- Product view
- Add to cart
- Add to wishlist
- Review order
- Refund
- Product search
- Product share
- Product listview
- Cart view
- Payment information
- Game Analysis
- Tutorial complete
- Create character
- Stage complete
- Level up
User Analytics
Login / Logout Event
You can analyze your app users' login and logout events.
When login is successful, send user ID (user defining parameter) as following.
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); }}
Comments
0 comments
Please sign in to leave a comment.