Event
This document explains what you need to do to analyze user behavior using the DFINERY SDK. SDK integration is required to use this.
Before you start
Before linking an event, register the event in the DFINERY console. To register an event, go to the console's Additional Settings > Data Linkage > Event Management > Event List page and click the Create Event button to create standard and custom events.
Note
Events will not be logged if unregistered events or event properties are entered.
If the type of the event attribute entered does not match the event attribute type, the event will not be recorded.
If an event property that is required for an event is missing, the event will not be logged.
A maximum of 100 products can be entered per event.
Event Log
logEvent
Log user events using methods. Standard events provide constants.
void logEvent(String eventName)
void logEvent(String eventName, JSONObject properties)
Each parameter means:
eventName
: Event Nameproperties
: Event properties
Event log example
// If there is no attribute
Dfinery.getInstance().logEvent(DFEvent.SIGN_UP);
// If there is an attribute
JSONObject properties = new JSONObject();
properties.put(DFEventProperty.SHARING_CHANNEL, "Kakao");
Dfinery.getInstance().logEvent(DFEvent.SIGN_UP, properties);
Standard Events and Properties
Standard events, standard event properties, and product properties are as follows:
Standard Events
Standard event names are provided as predefined static constants:
DFEvent.LOGIN
df_login
Log in
DFEvent.LOGOUT
df_logout
Log out
DFEvent.SIGN_UP
df_sign_up
Loin the membership
DFEvent.PURCHASE
df_purchase
Purchase
DFEvent.VIEW_HOME
df_view_home
View Home Screen
DFEvent.VIEW_PRODUCT_DETAILS
df_view_product_details
View product details
DFEvent.ADD_TO_CART
df_add_to_cart
Put in a shopping cart
DFEvent.ADD_TO_WISHLIST
df_add_to_wishlist
Add to Wishlist
DFEvent.REFUND
df_refund
Cancel order
DFEvent.VIEW_SEARCH_RESULT
df_view_search_result
Search for products
DFEvent.SHARE_PRODUCT
df_share_product
Share this product
DFEvent.VIEW_LIST
df_view_list
View product list
DFEvent.VIEW_CART
df_view_cart
View Cart
DFEvent.ADD_PAYMENT_INFO
df_add_payment_info
Enter purchase information
DFEvent.REMOVE_CART
df_remove_cart
Delete Cart
Standard event properties
For property names of standard events, event property names are provided as predefined static constants as follows:
DFEventProperty.ITEMS
df_items
Goods
DFEventProperty.TOTAL_REFUND_AMOUNT
df_total_refund_amount
Total refund (cancellation) amount
DFEventProperty.ORDER_ID
df_order_id
Order Number (ID)
DFEventProperty.DELIVERY_CHARGE
df_delivery_charge
Shipping Fee
DFEventProperty.PAYMENT_METHOD
df_payment_method
Payment Method
DFEventProperty.TOTAL_PURCHASE_AMOUNT
df_total_purchase_amount
Order Total
DFEventProperty.SHARING_CHANNEL
df_sharing_channel
Product sharing channel
DFEventProperty.SIGN_CHANNEL
df_sign_channel
Product Discount Price
DFEventProperty.KEYWORD
df_keyword
Search Keywords
Product Attributes
Information about standard event properties for products, which are loaded as an array in DFEventProperty.ITEMS. ITEM_ID, ITEM_NAME, ITEM_PRICE, ITEM_QUANTITY, and ITEM_DISCOUNT are required values and must be included.
DFEventProperty.ITEM_ID
df_item_id
String
Product Number (ID)
✅
DFEventProperty.ITEM_NAME
df_item_name
String
Product Name
✅
DFEventProperty.ITEM_PRICE
df_price
Number
Product unit price
✅
DFEventProperty.ITEM_QUANTITY
df_quantity
Number
Product Quantity
✅
DFEventProperty.ITEM_DISCOUNT
df_discount
Number
Product Discount Price
✅
DFEventProperty.ITEM_CATEGORY1
df_category1
String
Product Category 1
DFEventProperty.ITEM_CATEGORY2
df_category2
String
Product Category 2
DFEventProperty.ITEM_CATEGORY3
df_category3
String
Product Category 3
DFEventProperty.ITEM_CATEGORY4
df_category4
String
Product Category 4
DFEventProperty.ITEM_CATEGORY5
df_category5
String
Product Category 5
Example of using standard events
Log in
This event indicates that a user has signed up as a member of the service.
If you set the user identification information that you logged in with , the information will be reflected in the unified ID, allowing you to more clearly identify the user.
Dfinery.getInstance().logEvent(DFEvent.LOGIN);
Log out
This event indicates that a user is logging out of the app.
Dfinery.getInstance().logEvent(DFEvent.LOGOUT);
Join the membership
This event indicates the action taken by a user to sign up as a member.
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.SHARING_CHANNEL, "Kakao");
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.SIGN_UP, properties);
Standard event properties
DFEventProperty.SHARING_CHANNEL
String
Membership Channel
✅
Purchase
An event that represents a user's action of purchasing a product or service.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
properties.put(DFEventProperty.ORDER_ID, "Product Number");
properties.put(DFEventProperty.PAYMENT_METHOD, "BankTransfer");
properties.put(DFEventProperty.TOTAL_PURCHASE_AMOUNT, 25500.0);
properties.put(DFEventProperty.DELIVERY_CHARGE, 3000.0);
properties.put(DFEventProperty.DISCOUNT, 0);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.PURCHASE, properties);
Standard event properties
DFEventProperty.ORDER_ID
String
Order Number (ID)
✅
DFEventProperty.PAYMENT_METHOD
String
Payment Method
✅
DFEventProperty.TOTAL_PURCHASE_AMOUNT
Double
Order Total
✅
DFEventProperty.DELIVERY_CHARGE
Double
Shipping Fee
✅
DFEventProperty.DISCOUNT
Double
Product discount price
✅
View Home Screen
View product detailsThis event indicates that the user is viewing the app's home screen.
Dfinery.getInstance().logEvent(DFEvent.VIEW_HOME);
View product details
This event represents an action taken by a user to view detailed information about a specific product.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.VIEW_PRODUCT_DETAILS, properties);
Standard event properties
Put in a shopping cart
This event represents the action of a user adding a product to the shopping cart.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.ADD_TO_CART, properties);
Standard event properties
Add to Wishlist
This event indicates that a user has added a product to their interest list.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.ADD_TO_WISHLIST, properties);
Standard event properties
Search for products
This event represents the action of a user searching for a product and checking the results.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
properties.put(DFEventProperty.TOTAL_REFUND_AMOUNT, 22500.0);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.REFUND, properties);
Standard event properties
DFEventProperty.TOTAL_REFUND_AMOUNT
Double
Search for productsTotal refund (cancellation) amount
✅
Share this product
This event represents a user's action of sharing a product.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
properties.put(DFEventProperty.KEYWORD, "Pork belly");
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.VIEW_SEARCH_RESULT, properties);
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
properties.put(DFEventProperty.SHARING_CHANNEL, "Facebook");
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.SHARE_PRODUCT, properties);
Standard event properties
DFEventProperty.SHARING_CHANNEL
Enum
Search Keywords
✅
View product list
This event indicates the user's action of viewing a product list.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.VIEW_LIST, properties);
Standard event properties
View Cart
This event indicates the user's action of viewing the shopping cart.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.VIEW_CART, properties);
Standard event properties
Enter purchase information
This event represents the action of a user entering purchase information.
Dfinery.getInstance().logEvent(DFEvent.ADD_PAYMENT_INFO);
Delete Cart
This event indicates that a user removes a product from their shopping cart.
JSONObject item = new JSONObject();
try {
item.put(DFEventProperty.ITEM_ID, "Product Number");
item.put(DFEventProperty.ITEM_NAME, "Product Name");
item.put(DFEventProperty.ITEM_CATEGORY1, "Food");
item.put(DFEventProperty.ITEM_CATEGORY2, "Snack");
item.put(DFEventProperty.ITEM_PRICE, 5000.0);
item.put(DFEventProperty.ITEM_DISCOUNT, 500.0);
item.put(DFEventProperty.ITEM_QUANTITY, 5L);
} catch (JSONException e) {
e.printStackTrace();
}
JSONArray items = new JSONArray();
items.put(item);
JSONObject properties = new JSONObject();
try {
properties.put(DFEventProperty.ITEMS, items);
} catch (JSONException e) {
e.printStackTrace();
}
Dfinery.getInstance().logEvent(DFEvent.REMOVE_CART, properties);
Standard event properties
Custom Events
This is an event that reflects the user's input of an arbitrary event name and properties. You can also use standard events by adding custom properties in the DFINERY Console.
If there is no attribute
Dfinery.getInstance().logEvent("CUSTOM_EVENT_NAME", null);
If there is an attribute
JSONObject properties = new JSONObject();
properties.put("CUSTOM_PROPERTY_KEY", "CUSTOM_PROPERTY_VALUE");//Custom property values(Optional)
Dfinery.getInstance().logEvent("CUSTOM_EVENT_NAME", properties);
Enter date and time format properties
Date and time formats yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
must be entered as strings in the format.
JSONObject properties = new JSONObject();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DFEventProperty.FORMAT_DATETIME, Locale.US);
Date currentDate = new Date();
try {
properties.put("CUSTOM_PROPERTY_KEY", simpleDateFormat.format(currentDate));
} catch (JSONException e) {
throw new RuntimeException(e);
}
Dfinery.getInstance().logEvent(DFEvent.SIGN_UP, properties);
Data collected automatically
DFINERY automatically collects the following information:
Session Analysis
DFINERY uses activity lifecycle callbacks to divide sessions.
App Set ID
DFINERY automatically collects App Set Id to identify users.
Terminal information
DFINERY automatically collects the following terminal information:
This value may not be collected depending on the app's environment and granted permissions.
Model of the terminal
SM-G973N
Operating system of the terminal
12
The carrier currently connected to the terminal
SKTelecom
The language set on the terminal
ko
The terminal's set region
ko_KR
Set Time Zone Offset of the terminal
540
Whether the terminal has a phone function
true
The type of network the terminal is currently connected to.
wifi
Device manufacturer of the terminal
samsung
Application Information
DFINERY automatically collects the following application information:
App version of the application
1.0.30
The package name of the application
com.igaworks.dfinerydemo
Last updated