Integrating Definery (Adbrix) [iOS]
Follow
Quick Start
We guide you through the minimum integration steps to use Definery.
[[인용:보통:위험]]
System Requirements
Definery iOS SDK operates in the following environments.
1. Build environment: Xcode
2. Xcode version: 14.1 or higher (We recommend using the latest version.)
SDK installation through CocoaPods
To get started by installing the SDK into an existing Xcode project, follow these instructions:
Preparing CocoaPods
CocoaPods is a tool that automatically downloads, installs, and configures external libraries by entering a few lines of settings in a document file called Podfile.
adbrix supports silent installation via CocoaPods and is highly recommended.
Create Podfile
Go to the project folder and enter the following command in the terminal to create a Podfile.
$ pod init
Edit Podfile
target "myXcodeProject" do
use_frameworks!
pod 'AdBrixRmKit'
end
[[Quote:Warning:Small]] Please make sure to use the specified version of the SDK.
[[Quote:Notice:General]]
Definery iOS v2 SDK release information
v2 SDK with new features has been released. Check out the update method in the document below!
[
Check the Definery iOS v2 SDK release guide
]
* The number in platform refers to the minimum iOS version supported by the XCode project.
* In plain text editors, errors may occur due to encoding problems.
SDK Pod Install
Install the Definery (Adbrix) SDK by entering and executing the following command in the terminal.
$ pod install
[[Quote: Instructions: Normal]] When a pod install error occurs, execute the “pod setup” command.
Swift Library Settings
Since Definery (Adbrix) SDK is written in Swift, the following settings must be made in Objective-C-based projects.
Set [ Build Settings > Always Embed Swift Standard Libraries ] to ' yes '.
SDK import path
Once the SDK is ready to use, use the import path for the SDK as shown below.
App key & secret key settings
Register the app key and secret key issued from the adbrix console.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // Set adbrix appKey & secretKey adBrix.initAdBrix(appKey: "odhvASVRDsdf10d019fva", secretKey: "ar98LszQZUGdmSznToNBXg") return true }
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Set adbrix appKey & secretKey [adBrix initAdBrixWithAppKey:@"odhvASVRDsdf10d019fva" secretKey:@"ar98LszQZUGdmSznToNBXg"]; return YES; }
Apple Advertising Identifier (IDFA) Settings
AdBrixRm uses IDFV as the device ID by default, but can be configured to collect IDFA for attribution and other purposes.
IDFA settings can be set with the code below in the ATT pop-up API. (The default setting is IDFA off.)
import AdBrixRmKit import AppTrackingTransparency @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func applicationDidBecomeActive(_ application: UIApplication) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance if #available(iOS 14, *) { ATTrackingManager.requestTrackingAuthorization {(status) in switch status{ case.authorized: adBrix.startGettingIDFA() case.denied: adBrix.stopGettingIDFA() case.notDetermined : adBrix.stopGettingIDFA() case.restricted: adBrix.stopGettingIDFA() default: adBrix.stopGettingIDFA() } } } }
#import <AdBrixRmKit/AdBrixRmKit.h> #import <AppTrackingTransparency/AppTrackingTransparency.h> @interface AppDelegate () @end @implementation AppDelegate - (void)applicationDidBecomeActive:(UIApplication *)application { // Create AdBrixRM Instance, Only need with Adbrix RN Plugin V2 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; } }]; } } }
[[Quote:Guide:Normal]]
Check App Key & Secret Key
_ App key and secret key are identifiers that Adbricks uses to distinguish apps.
_ The same key value must be linked to Android and iOS.
_ This is a value absolutely necessary for SDK integration. You can check it after registering the app in the Adbricks console.
How to check app key and secret key
/
Adbricks console shortcut
Additional SDK settings
Once the basic settings for the Definery (Adbrix) SDK are completed, you can proceed with additional settings for the SDK as follows.
- Event upload cycle settings
- GDPR settings
- Deep link settings
Event upload cycle settings
You can set standards for transmitting events delivered to the Definery (Adbrix) SDK to the Definery (Adbrix) server.
You can set the event upload cycle based on the cumulative number of events and time.
* Events are uploaded according to which of the two criteria is met first.
Based on the cumulative number of events
Set to upload events to the DFINERY (Adbrix) server when the set number of events is accumulated.
Set using the values below predefined in the DFINERY (Adbrix) SDK.
- AdBrixEventUploadCountInterval.MIN: 10
- AdBrixEventUploadCountInterval.NORMAL: 30
- AdBrixEventUploadCountInterval.MAX: 60
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // If event count is 10, upload event to adbrix server adBrix.setEventUploadCountInterval(AdBrixRM.AdBrixEventUploadCountInterval.MIN) return true }
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // If event count is 10, upload event to adbrix server [adBrix setEventUploadCountInterval:AdBrixEventUploadCountIntervalMIN]; return YES; }
based on time
Set the event to be uploaded to the DFINERY (Adbrix) server after the set time.
Set using the values below predefined in the DFINERY (Adbrix) SDK.
- AdBrixEventUploadTimeInterval.MIN: 30 seconds
- AdBrixEventUploadTimeInterval.NORMAL:60 seconds
- AdBrixEventUploadTimeInterval.MAX:120 seconds
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // Set Event Upload Timer : every 30 seconds upload events to server adBrix.setEventUploadTimeInterval(AdBrixRM.AdBrixEventUploadTimeInterval.MIN) return true }
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Set Event Upload Timer : every 30 seconds upload events to server [adBrix setEventUploadTimeInterval:AdBrixEventUploadTimeIntervalMIN]; return YES; }
GDPR settings
You can use the GDPR request event to no longer collect any personal data associated with the data subject in response to a user request.
When this event is called, SDK operation is stopped and all event saving or transmission is not possible.
This feature cannot be restored until the user deletes and reinstalls the app.
func gdprForgetMeEvent() { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance adBrix.gdprForgetMe() }
- (IBAction)click_gdprForgetMe:(id)sender { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; [adBrix gdprForgetMe]; }
Deep link/deferred deep link event analysis
Analyzes opened events through URLs with deep links set.
To perform analysis, a url scheme must be set in the app.
Deep link open analysis
Go to [ General > Target > Info > URL Types ] and set the URL Scheme as follows.
Add the application(_ app: open url: options:) delegate to AppDelegate and call the tracking code as follows.
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // Add Deep Link Open Tracking Code adBrix.deepLinkOpen(url: url) return false }
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Add Deep Link Open Tracking Code [adBrix deepLinkOpenWithUrl:url]; return YES; }
When using UIScene added since iOS13, add it to sceneDelegate.swift as follows.
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance if connectionOptions.urlContexts.first?.url != nil { let urlinfo = connectionOptions.urlContexts.first?.url // Add Deep Link Open Tracking Code adBrix.deepLinkOpen(url:urlinfo!) } } func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { let url = URLContexts.first!.url // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // Add Deep Link Open Tracking Code adBrix.deepLinkOpen(url:url) }
@interface SceneDelegate () @end @implementation SceneDelegate - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; if ((connectionOptions.URLContexts.allObjects.firstObject.URL) != nil) { NSURL *url = connectionOptions.URLContexts.allObjects.firstObject.URL; // Add Deep Link Open Tracking Code [adBrix deepLinkOpenWithUrl:url]; } } - (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts { NSURL *url = URLContexts.allObjects.firstObject.URL; // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Add Deep Link Open Tracking Code [adBrix deepLinkOpenWithUrl:url]; }
universal link
Go to [ General > Target > Capablities > Associated Domains ] and set up the universal link as follows.
[[Quote:Warning:Medium]] When adding a universal link, add it as applinks:your_appkey.adtouch.adbrix.io, and in the " your_appkey " field, add the Appkey you use when linking . The Appkey uses only lowercase letters .
Afterwards, add the code below to AppDelegate to analyze apps opened as universal links.
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, let incomingURL = userActivity.webpageURL else { return false } print("DEEPLINK :: UniversialLink was clicked !! incomingURL - \(incomingURL)") NSLog("UNIVERSAL LINK OPEN!!!!!!!!!!!!!!!!!") let adBrix = AdBrixRM.getInstance adBrix.deepLinkOpen(url: incomingURL) return true }
-(BOOL)application:(UIApplication* )application continueUserActivity:(NSUserActivity* )userActivity restorationHandler:(void (^)(NSArray * _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 YES; }
When using UIScene added since iOS13, add it to sceneDelegate.swift as follows.
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { let adBrix = AdBrixRM.getInstance if let userActivity = connectionOptions.userActivities.first, userActivity.activityType == NSUserActivityTypeBrowsingWeb, let urlinfo = userActivity.webpageURL{ print ("Universial Link Open on SecneDelegate wiillConnectTo") adBrix.deepLinkOpen(url:urlinfo) } guard let _ = (scene as? UIWindowScene) else { return } } func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { let adBrix = AdBrixRM.getInstance if userActivity.activityType == NSUserActivityTypeBrowsingWeb, let urlinfo = userActivity.webpageURL{ adBrix.deepLinkOpen(url:urlinfo) } }
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { AdBrixRM * adBrix = [AdBrixRM sharedInstance]; NSUserActivity* userActivity = [[[connectionOptions userActivities]allObjects]firstObject]; NSURL * urlInfo = userActivity.webpageURL; if (urlInfo != nil) { [adBrix deepLinkOpenWithUrl:urlInfo]; } } - (void)scene:(UIScene *) scene continueUserActivity:(nonnull NSUserActivity *)userActivity{ AdBrixRM * adBrix = [AdBrixRM sharedInstance]; NSURL * urlInfo = userActivity.webpageURL; if (urlInfo != nil) { [adBrix deepLinkOpenWithUrl:urlInfo]; } }
[[Quote: Risk: Moderate]] Be sure to check before linking to Universal Link!
To use Universal Link, be sure to set the deep link pass method to "dynamic pass" when creating a tracking link, enter the deep link path to be moved in the deeplink_custom_path value, which is a parameter attached to the created tracking link, and pass it to Universal Link.
Universal Link is an optional feature. If you are not using Universal Link, this is not required.
Deferred deep link tracking
When installing and running the app through a tracking link, if you want to land on a specific screen using the deep link information attached to the tracking link, add the code along with the deep link code above.
[[Quote: Risk: Small]] - The value transmitted from the deferred deep link is transmitted as a string value, as shown in the example below.
Example: yourscheme://your_custom_path
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, AdBrixRMDeferredDeeplinkDelegate{ var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let adBrix = AdBrixRM.getInstance // Add Deferred Deep Link Delegate adBrix.delegateDeferredDeeplink = self return true } // Deferred Deep Link Trakcing func didReceiveDeferredDeeplink(deeplink: String) { print("DEEPLINK :: received - \(deeplink)") // you should convert view using "deeplink" value }
// Open the AppDelegate.h and add "AdBrixRMDeferredDeeplinkDelegate" #import <UIKit/UIKit.h> #import <AdBrixRmKit/AdBrixRmKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate,AdBrixRMDeferredDeeplinkDelegate> @end //AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Add Deferred Deep Link Delegate [adBrix setDeferredDeeplinkDelegateWithDelegate:self]; return YES; } // Deferred Deep Link Trakcing - (void)didReceiveDeferredDeeplinkWithDeeplink:(NSString * _Nonnull)deeplink { NSLog(@"ADBRIXRM DEEPLINK RECEIVE : %@ ", deeplink); // you should convert view using "deeplink" value }
*. Caution : If you are performing separate UI-related work with values such as deferred deep links, you must do so on the main thread .
[[Quote:Warning:Normal]]
Listener is not called!!!
If deferred deep link information is not delivered to the listener you implemented, please check the following:
1. No conversion occurred via tracking link.
2. Deep linking is not set up in the tracking link.
[[Quote:Danger:Small]]
fetchDeferredAppLinkData API from Facebook SDK is not available
.
Our DeferredDeeplink API takes over the role of fetchDeferredApplinkData used in Facebook advertising, so it cannot be used repeatedly. If you are using it, please delete it.
Event Analysis
By analyzing in-app events that occur in the app, you can construct reports and send postbacks.
To analyze an event, you must insert an event analysis code at the time an event occurs and transmit the event identification value.
Definery (Adbrix) provides three major categories of analysis.
-
User analysis
- Login/logout events
- User information
- custom analytics
-
Common (general) analysis
- join the membership
- app updates
- user invitation
- credit usage
- purchase
-
Commerce Analytics
- View product details
- Put in a shopping cart
- Add product of interest
- Confirm your order
- Cancel order
- Search for product
- Share product
- View product list
- View shopping cart
- Enter payment information
-
game analysis
- Tutorial completed
- character generation
- Stage completed
- Level achieved
User analysis
Login/logout events
Analyze user login/logout events.
When login is successful, the identification value (user ID) that identifies the user is transmitted as follows.
[[인용:보통:위험]]
Login Precautions
The user ID used for login is used for matching between users and devices when using the growth action function. If login is called again without logging out after logging in, correct matching may not occur.
Please be careful not to include personal information in your user ID. If the user ID includes personal information such as email or phone number, we recommend encrypting it.
@IBAction func login_and_logout_event(_ sender: Any) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance if(isLoginSuccess) { // When a user logs on with "user_1234" information adBrix.login(userId:"user_1234") } else { // When a user logs out adBrix.logout() } }
- (void)loginAndLogoutEvent { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; if(isSuccessLogin) { // When a user logs on with "user_1234" information [adBrix loginWithUserId:@"user_1234"]; } }
User information
You can analyze the users age, gender, and other information.
[[인용:보통:위험]]
Precautions when setting user information
Please use the login, setAge, and setGender APIs for user ID, age, and gender, respectively.
@IBAction func user_property_update(_ sender: Any) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // User Age adBrix.setAge(int: 30) // User Gender adBrix.setGender(adBrixGenderType: AdBrixRM.AdBrixGenderType.Male) let attrModel = AdBrixRmAttrModel() attrModel.setAttrDataString("city", "seoul") attrModel.setAttrDataInt("height", 36) attrModel.setAttrDataBool("married", true) adBrix.setUserPropertiesWithAttr(attrModel: attrModel) }
- (void)userPropertyUpdate { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // User Age NSInteger age = 30; [adBrix setAgeWithInt:age]; // User Gender [adBrix setGenderWithAdBrixGenderType:AdBrixGenderTypeFemale]; AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new]; [attrModel setAttrDataString:@"city" :@"seoul"]; [attrModel setAttrDataBool:@"married" :true]; [adBrix setUserPropertiesWithAttrWithAttrModel:attrModel]; }
[[Quote:Risk:Medium]]
Things to keep in mind when setting AttrModel
1.100 or more pieces of information will not be processed.
2. The data type of the key value is string, cannot exceed 50 characters, and cannot use any characters other than lowercase English letters and numbers.
3. The data length of the Value value cannot exceed 1024 bytes in byte. Also, only Int, Long, Boolean, and String types can be used.
4. Null value cannot be used as Value value.
custom analytics
Analyzes all common user events within the app. (excluding purchase events)
You can freely analyze most actions within the app, such as 'button click', 'character creation', 'tutorial completion', and 'level up'.
@IBAction func user_custom_event(_ sender: Any) { // Create adbrix Instance let adBrix = AdBrixRM.getInstance // Addtional event parameter let attrModel = AdBrixRmAttrModel() attrModel.setAttrDataString("grade", "vip") attrModel.setAttrDataInt("quantity", 36) // Click a button "Invite a friend" adBrix.eventWithAttr(eventName: "invite_button_click", value: attrModel) // Complete "Character creation" adBrix.eventWithAttr(eventName: "create_character_complete", value: attrModel) // Complete "Tutorial view" adBrix.eventWithAttr(eventName: "tutorial_complete", value: attrModel) // Achieve "Level 10" adBrix.eventWithAttr(eventName: "level_10", value: attrModel) }
- (void)userCustomEvent { // Create adbrix Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Addtional event parameter AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new]; [attrModel setAttrDataString:@"userid" :@"peterPark1234"]; [attrModel setAttrDataString:@"grade" :@"vip"]; [attrModel setAttrDataInt:@"quantity" :36]; // Click a button "Invite a friend" [adBrix eventWithAttrWithEventName:@"invite_button_click" value:attrModel]; // Complete "Character creation" [adBrix eventWithAttrWithEventName:@"create_character_complete" value:attrModel]; // Complete "Tutorial view" [adBrix eventWithAttrWithEventName:@"tutorial_complete" value:attrModel]; // Achieve "Level 10" [adBrix eventWithAttrWithEventName:@"level_10" value:attrModel]; }
[[Quote:Risk:Medium]] Custom events can only be set to a maximum of 100, in the order they are called.
※ caution
If you set an event name for almost any situation as in the case below for a custom event, countless events will be created according to each situation.
// AdBrixRM 인스턴스 생성 let adBrix = AdBrixRM.getInstance adBrix.event("custom:Lev-37 cleared,clearTime:00:00:39.2343535")
Therefore, in this case, please set additional event information (AdBrixRm.AttrModel) and set custom parameters to call the event.
// AdBrixRM 인스턴스 생성 let adBrix = AdBrixRM.getInstance // 이벤트 추가정보 설정 let attrModel = AdBrixRmAttrModel() attrModel.setAttrDataInt(“level”, 37) attrModel.setAttrDataInt(“clear_time_mile”, 39238) // 이벤트 파라미터와 함께 커스텀 이벤트 API 호출 AdBrixRm.eventWithAttr("level_clear", value: attrModel)
Common (general) event analysis
Among the events that occur in the app, we analyze the commonly occurring event (payment).
Common event types provided by DFINERY (Adbrix) are as follows.
- join the membership
- app updates
- user invitation
- credit usage
- Make payment
* If you want to view sales by advertising channel in DFINERY (Adbrix), you must perform the ‘Payment’ link.
join the membership
Analyze membership registration events that occurred in the app.
@IBAction func userRegister(_ sender: Any) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance let attrModel = AdBrixRmAttrModel() attrModel.setAttrDataString("grade", "vip") attrModel.setAttrDataInt("height", 36) attrModel.setAttrDataBool("married", true) // Register API adBrix.commonSignUpWithAttr(channel: AdBrixRM.AdBrixRmSignUpChannel.AdBrixRmSignUpGoogleChannel, commonAttr: attrModel) }
- (void) registerEvent { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"grade" :@"vip"]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Register API [adBrix commonSignUpWithAttrWithChannel:AdBrixRmSignUpChannelAdBrixRmSignUpGoogleChannel commonAttr:attrModel]; }
app updates
Analyze app update events that occurred in the app.
@IBAction func appUpdate(_ sender: Any) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // User Information let attrModel = AdBrixRmAttrModel() attrModel.setAttrDataString("grade", "vip") attrModel.setAttrDataInt("height", 36) attrModel.setAttrDataBool("married", true) // App Update API adBrix.commonAppUpdateWithAttr(prev_ver: "1.0.1", curr_ver: "1.0.3", commonAttr: attrModel) }
- (void) appUdate { // Create AdBrixRM Instance AdBrixRM *adbrix = [AdBrixRM sharedInstance]; // User Information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"grade" :@"vip"]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // App Update API [adBrix commonAppUpdateWithAttrWithPrev_ver:@"1.0.2" curr_ver:@"1.0.4" commonAttr:attrModel]; }
user invitation
Analyze app invitation events that occurred in the app.
@IBAction func userInvite(_ sender: Any) { // Create AdBrix Instance let adBrix = AdBrixRM.getInstance // User Information let attrModel = AdBrixRmAttrModel() attrModel.setAttrDataString("grade", "vip") attrModel.setAttrDataInt("height", 36) attrModel.setAttrDataBool("married", true) // User Invitation API adBrix.commonInviteWithAttr(channel: AdBrixRM.AdBrixRmInviteChannel.AdBrixRmInviteLineChannel, commonAttr: attrModel) }
- (void) userInvite { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // User Information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"grade" :@"vip"]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // User Invitaion API [adBrix commonInviteWithAttrWithChannel:AdBrixRmInviteChannelAdBrixRmInviteKakaoChannel commonAttr:attrModel]; }
credit usage
Analyze events related to the use of cash currency within the app.
@IBAction func useCredit(_ sender: Any) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // User Information let attrModel = AdBrixRmAttrModel() attrModel.setAttrDataString("grade", "vip") attrModel.setAttrDataInt("height", 36) attrModel.setAttrDataBool("married", true) attrModel.setAttrDataInt("credit", 123456) // Use Credit API adBrix.commonUseCreditWithAttr(commonAttr: attrModel) }
- (void) useCredit { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // User Information AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new]; [attrModel setAttrDataString:@"nickname" :@"peter"]; [attrModel setAttrDataString:@"grade" :@"vip"]; [attrModel setAttrDataInt:@"credit" :5000.00]; [attrModel setAttrDataBool:@"married" :true]; // Use Credit API [adBrix commonUseCreditWithAttrWithCommonAttr:attrModel]; }
Make payment
[[인용:보통:위험]] Total order amount parameter added!!! (sdk ver: 1.6.5200)
A parameter has been added to enter the total sales amount of the order. Please enter the amount based on the order total amount calculation criteria.
Analyze payment (purchase) events that occurred in the app.
The following information about products and orders is organized and delivered in an array format.
- order id: (required) order number
- orderSales: (required) Total order amount
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string: (required) Purchase currency unit
- category : (optional) category information
- product attr map: (optional) product detail options
- delivery charge: (optional) delivery charge
- payment method: (optional) payment method
@IBAction func purchase_event(_ sender: Any) {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("quantity", 36)
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// Product Model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "clothes", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Purchase API
adBrix.commonPurchaseWithAttr(orderId: "orderid_1",
productInfo: proArr,
orderSales: 22500.00,
discount: 1500.00,
deliveryCharge: 2500.00,
paymentMethod: AdBrixRM.AdbrixRmPaymentMethod.CreditCard,
orderAttr: attrModel)
}
- (void)purchaseEvent {
// Create AdBrix Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Create Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"quantity" :36];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Create Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// Product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Purchase API
[adBrix commonPurchaseWithAttrWithOrderId:@"orderID1"
productInfo:productArray
orderSales: 22500.00
discount:10000.00
deliveryCharge:2500.00
paymentMethod:[adBrix getPaymentMethod:AdbrixRmPaymentMethodCreditCard]
orderAttr:attrModel];
}
Commerce Analytics
Analyzes purchase-related events (viewing product details, adding to shopping cart, etc.) that occur in the app.
The types of commerce events provided by DFINERY (Adbrix) are as follows.
- Enter the home (main) screen
- Enter category (special exhibition)
- View product details
- Put in a shopping cart
- Add wishlist (product of interest)
- Confirm your order
- Cancel order
- Search for product
- View product list
- View shopping cart
- Enter payment information
Enter the home (main) screen
Analyze events in which the user enters the apps home (main) screen.
@IBAction func viewHomeEvent(_ sender: Any) { // Create AdBrixRM Instance let adBrix = AdBrixRM.getInstance // View Home API adBrix.commerceViewHome() }
- (void)viewHomeEvent { // Create AdBrixRM Instance AdBrixRM *adBrix = [AdBrixRM sharedInstance]; // Home View API [adBrix commerceViewHome]; }
Enter category (special exhibition)
Analyze events in which users enter the category (special exhibition) screen.
Category information can be analyzed up to 5 levels.
@IBAction func viewCategoryEvent(_ sender: Any) {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// Product model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "clothes", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product list array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Category View API
adBrix.commerceCategoryViewWithAttr(category: adBrix.createCommerceProductCategoryData(category: "clothes", category2: "skirt", category3: "female", category4: "dress", category5: "spring"),
productInfo: proArr,
orderAttr: attrModel)
}
- (void)viewCategoryEvent {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Create Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// Product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Category View API
[adBrix commerceCategoryViewWithAttrWithCategory:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productInfo:productArray orderAttr:attrModel];
}
View product details
We analyze this event in detail about your product.
We convey information about the following products.
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string: (required) Purchase currency unit
- category : (optional) category information
- product attr map: (optional) product detail options
@IBAction func viewProductDetailEvent(_ sender: Any) {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product Model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product View API
adBrix.commerceProductViewWithAttr(productInfo: productModel1, orderAttr: attrModel)
}
- (void)viewProductDetailEvent {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrModel
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Product View API
[adBrix commerceProductViewWithAttrWithProductInfo:product1 orderAttr:attrModel];
}
Put in a shopping cart
Analyze events in which users add products to their shopping cart.
We convey the following product information:
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
- product attr map: (optional) product detail options
@IBAction func addToCartEvent(_ sender: Any) {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product Model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// product model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "cloth", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Add to Cart API
adBrix.commerceAddToCartWithAttr(productInfo: proArr, orderAttr: attrModel)
}
- (void)addToCartEvent {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// Product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Add to Cart API
[adBrix commerceAddToCartWithAttrWithProductInfo:productArray orderAttr:attrModel];
}
Add product of interest (wish list)
Analyze events in which a user adds a product to a product of interest (wishlist).
We convey the following product information:
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
- product attr map: (optional) product detail options
API (when applying individual ProductModel)
@IBAction func addToWishListEvent(_ sender: Any) {
// Create adbrix Instance
let adBrix = AdBrixRM.getInstance
// event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// product option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// create product model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Add to wishlist api
adBrix.commerceAddToWishListWithAttr(productInfo: productModel1, orderAttr: attrModel)
}
- (void)addToWishListEvent {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Add to Wishlist API
[adBrix commerceAddToWishListWithAttrWithProductInfo:product1 orderAttr:attrModel];
}
API (when applying multiple ProductModels)
[[인용:보통:위험]] This API applies from iOS SDK 2.4.0.1.
@IBAction func addToWishListEvent(_ sender: Any) {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product Model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// product model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "cloth", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Add to Wishlist API
adBrix.commerceAddToWishListWithAttr(productInfo: proArr, orderAttr: attrModel)
}
- (void)addToWishListEvent {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// Product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Add to Wishlist API
[adBrix commerceAddToWishList:productArray orderAttr:attrModel];
}
Confirm your order
We analyze the final confirmation event that a user confirms before paying for a product.
We convey the following order and product information:
- order id: (required) order number
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
- product attr map: (optional) product detail options
- delivery charge: (optional) delivery charge
@IBAction func reviewOrderEvent(_ sender: Any) {
// Create AdBrix Instance
let adBrix = AdBrixRM.getInstance
// event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product option AttrModel2
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// product model2
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "cloth", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Review Order API
adBrix.commerceReviewOrderWithAttr(orderId: "orderID_2",
productInfo: proArr,
discount: 2500.00,
deliveryCharge: 3000.00,
orderAttr: attrModel)
}
- (void)reviewOrderEvent {
// Create AdBrix Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Create Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Create Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
//productList Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Review order api
[adBrix commerceReviewOrderWithAttrWithOrderId:@"orderID_11" productInfo:productArray discount:5000.00 deliveryCharge:2500.00 orderAttr:attrModel];
}
Cancel order (refund)
Analyze events in which a user canceled an order or issued a refund.
We convey the following product and order information:
- order id: (required) order number
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
- product attr map: (optional) product detail options
- penalty charge: (Optional) Cancellation (refund) fee
func refundOrderEvent() {
// Create AdBrix Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// Product model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "cloth", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Refund API
adBrix.commerceRefundWithAttr(orderId: "orderID_3",
productInfo: proArr,
penaltyCharge: 250000.00,
orderAttr: attrModel)
}
- (void)refundOrderEvent {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// Product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Refund API
[adBrix commerceRefundWithAttrWithOrderId:@“orderID1” productInfo:productArray penaltyCharge:25000.00 orderAttr:attrModel];
}
Search for products
Analyze events in which users search for products.
We deliver product information included in the following search results.
- keyword: (required) Word used in search
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
@IBAction func searchResultEvent() {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Create Product Model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// Product Model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "cloth", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Product Search API
adBrix.commerceSearchWithAttr(productInfo: proArr,
keyword: "This is a search keyword.",
orderAttr: attrModel)
}
- (void)searchResultEvent {
// Create AdBrix Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// Product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Product Search API
[adBrix commerceSearchWithAttrWithProductInfo:productArray keyword:@"상품 검색어" orderAttr:attrModel];
}
Share product
Analyze events in which users share product information.
We communicate shared product information such as:
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
- product attr map: (optional) product detail options
API (when applying individual ProductModel)
@IBAction func shareEvent(_ sender: Any) {
// Create AdBrix Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product Model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Share API
adBrix.commerceShareWithAttr(channel: AdBrixRM.AdBrixRmSharingChannel.AdBrixRmSharingKakaoStory,
productInfo: productModel1,
orderAttr: attrModel)
}
- (void)shareEvent() {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Product Share API
[adBrix commerceShareWithAttrWithChannel:AdBrixRmSharingChannelAdBrixRmSharingWeChat productInfo:product1 orderAttr:attrModel];
}
API (when applying multiple ProductModels)
[[인용:보통:위험]] This API applies from iOS SDK 2.4.0.1.
View product list
Analyze events in which users view product lists.
We will send you the product information you have viewed as follows.
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
- product attr map: (optional) product detail options
@IBAction func listViewEvent() {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// Product Model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "cloth", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// list view API
adBrix.commerceListViewWithAttr(productInfo: proArr, orderAttr: attrModel)
}
- (void)listViewEvent() {
// Create AdBrixRM Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// Product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// list view API
[adBrix commerceListViewWithAttrWithProductInfo:productArray orderAttr:attrModel];
}
View shopping cart
Analyze events in which users view their shopping carts.
We will send you the product information you have viewed as follows.
- product id: (required) product number
- product name: (required) product name
- price: (required) product price
- quantity : (required) Purchase quantity
- discount: (Optional) Discount amount
- currency string : (required) Category information
- category: (optional) purchase currency unit
- product attr map: (optional) product detail options
@IBAction func cartViewEvent() {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Product Option AttrModel
let productAttr1 = AdBrixRmAttrModel()
productAttr1.setAttrDataString("product_type", "computer")
productAttr1.setAttrDataString("color", "black")
productAttr1.setAttrDataInt("size", 36)
productAttr1.setAttrDataInt("current_point", 123456)
productAttr1.setAttrDataBool("promotion", true)
// Product Model
let productModel1 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_1",
productName: "productname 1",
price: 123456.00,
quantity: 1,
discount: 2500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "computer", category2: "PC", category3: "cd-rom", category4: "software", category5: "game"),
productAttrsMap: productAttr1)
// Product Option AttrModel
let productAttr2 = AdBrixRmAttrModel()
productAttr2.setAttrDataString("product_type", "pants")
productAttr2.setAttrDataString("color", "blue")
productAttr2.setAttrDataInt("size", 42)
productAttr2.setAttrDataInt("current_point", 234423)
productAttr2.setAttrDataBool("promotion", false)
// Product Model
let productModel2 = adBrix.createCommerceProductDataWithAttr(
productId: "productID_2",
productName: "product 2",
price: 700000.00,
quantity: 1,
discount: 3500.00,
currencyString: adBrix.getCurrencyString(AdBrixRM.AdBrixRmCurrencyType.KRW.rawValue),
category: adBrix.createCommerceProductCategoryData(category: "cloth", category2: "pants", category3: "jean", category4: "longpants", category5: "sales"),
productAttrsMap: productAttr2)
// Product List Array
var proArr : Array<AdBrixRmCommerceProductModel> = Array()
proArr.append(productModel1)
proArr.append(productModel2)
// Cart View API
adBrix.commerceCartViewWithAttr(productInfo: proArr, orderAttr: attrModel)
}
- (void)cartViewEvent() {
// Create AdBrix Instance
AdBrixRM *adbrix = [AdBrixRM sharedInstance];
// Create Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Product Option AttrModel
AdBrixRmAttrModel * productAttr1 = [AdBrixRmAttrModel new];
[productAttr1 setAttrDataString:@"product_type" :@"computer"];
[productAttr1 setAttrDataString:@"color" :@"black"];
[productAttr1 setAttrDataInt:@"size" :36];
[productAttr1 setAttrDataInt:@"cruurent_point" :123456];
[productAttr1 setAttrDataBool:@"promotion" :true];
// Product Model
AdBrixRmCommerceProductModel * product1 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID1"
productName:@"productName1"
price:10000.00
quantity:1
discount:2500.00
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cumputer" category2:@"PC" category3:@"cd-rom" category4:@"software" category5:@"game"]
productAttrsMap:productAttr1];
// Event AttrMode
AdBrixRmAttrModel * productAttr2 = [AdBrixRmAttrModel new];
[productAttr2 setAttrDataString:@"product_type" :@"pants"];
[productAttr2 setAttrDataString:@"color" :@"blue"];
[productAttr2 setAttrDataInt:@"size" :42];
[productAttr2 setAttrDataInt:@"cruurent_point" :23433];
[productAttr2 setAttrDataBool:@"promotion" :false];
// Product Model
AdBrixRmCommerceProductModel * product2 = [adBrix createCommerceProductDataWithAttrWithProductId:@"productID2"
productName:@"productName2"
price:23456.22
quantity:1
discount:2500.33
currencyString:[adBrix getCurrencyString:AdBrixRmCurrencyTypeKRW]
category:[adBrix createCommerceProductCategoryDataWithCategory:@"cloth" category2:@"pants" category3:@"jeans" category4:@"long pants" category5:@"sale"]
productAttrsMap:productAttr2];
// product List Array
NSMutableArray *productArray = [NSMutableArray array];
[productArray addObject:product1];
[productArray addObject:product2];
// Cart View API
[adBrix commerceCartViewWithAttrWithProductInfo:productArray orderAttr:attrModel];
}
Enter payment information
Analyze events in which users enter payment information.
@IBAction func paymentInfoAddedEvent(_ sender: Any) {
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataString("creditcard", "kbcard")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Payment API
adBrix.commercePaymentInfoAddedWithAttr(paymentInfoAttr: attrModel)
}
- (void)paymentInfoAddedEvent() {
// Create AdBrixRM instance
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
// payment attrModel
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataString:@"paymentinfo" :@"creditCard"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Payment API
[adBrix commercePaymentInfoAddedWithAttrWithPaymentInfoAttr:attrModel];
}
Game event analysis
Analyze game-related events (tutorials, stages, etc.) that occur in the app.
The types of game events provided by DFINERY (Adbrix) are as follows.
- Tutorial completed
- character generation
- Stage completed
- Level achieved
Tutorial completed
Analyze tutorial completion events that occur in the app.
We organize and deliver the following tutorial completion information.
- isSkip: (Required) Whether to complete by skipping
@IBAction func tutorialCompleteEvent(){
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Tutorial Complete API
adBrix.gameTutorialCompletedWithAttr(isSkip: true, gameInfoAttr: attrModel)
}
-(void) tutorialCompleteEvent {
// Create AdBrixRM instance
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Tutorial Complete API
[adBrix gameTutorialCompletedWithAttrWithIsSkip:false gameInfoAttr:attrModel];
}
character generation
Analyze character creation events that occurred in the app.
@IBAction func characterCreatedEvent(){
// Create AdBrix Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Create Character API
adBrix.gameCharacterCreatedWithAttr(gameInfoAttr: attrModel)
}
-(void) characterCreatedEvent {
// create AdBrixRM instance
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
// Create Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Create character API
[adBrix gameCharacterCreatedWithAttrWithGameInfoAttr:attrModel];
}
Stage completed
Analyze stage completion events that occur in the app.
Constructs and delivers the following stage completion information.
- stageName : (Required) Name of the completed stage
@IBAction func stageClearedEvent(){
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Stage Complete API
adBrix.gameStageClearedWithAttr(stageName: "1-5", gameInfoAttr: attrModel)
}
-(void) stageClearedEvent {
// Create AdBrixRM instance
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Stage Complete API
[adBrix gameStageClearedWithAttrWithStageName:@"1-43" gameInfoAttr:attrModel];
}
Level achieved
Analyze level achievement events that occurred in the app.
We organize and deliver the following level achievement information.
- level: (required) achieved level (1~10000)
@IBAction func levelAchievedEvent(){
// Create AdBrixRM Instance
let adBrix = AdBrixRM.getInstance
// Event AttrModel
let attrModel = AdBrixRmAttrModel()
attrModel.setAttrDataString("nickname", "peter")
attrModel.setAttrDataInt("credit", 10000)
attrModel.setAttrDataBool("married", true)
// Level up API
adBrix.gameLevelAchievedWithAttr(level: 55, gameInfoAttr: attrModel)
}
-(void) levelAchievedEvent {
// Create AdBrixRM instance
AdBrixRM *adBrix = [AdBrixRM sharedInstance];
// Event AttrMode
AdBrixRmAttrModel * attrModel = [AdBrixRmAttrModel new];
[attrModel setAttrDataString:@"nickname" :@"peter"];
[attrModel setAttrDataInt:@"credit" :5000.00];
[attrModel setAttrDataBool:@"married" :true];
// Level up API
[adBrix gameLevelAchievedWithAttrWithLevel:122 gameInfoAttr:attrModel];
}