How to record user events using the DFINERY SDK. must be done first.
Before you start
Before recording an event, please register the event in and then link it. You can register an event in the console's Additional Settings / Data Linkage / Event Management / Event List.
An event is not logged if an unregistered event, an event property, an event property of the wrong type, or if any of the registered event properties are missing.
Event Log
Log an event by calling one of the following logEvent
methods. The provide constants.
Swift Objective-C
Copy func logEvent(_ name: String)
func logEvent(_ name: String, properties: [String: Any])
Each parameter means:
properties
: event properties
Example usage
Copy // Path to record only events
Dfinery.shared().logEvent(DFEvent.LOGIN)
// When recording with event properties
Dfinery.shared().logEvent(
"custom_event",
properties: ["custom_key": "custom_value"]
)
// When recording all event properties and items
let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "apple",
DFEventProperty.ITEM_PRICE: 1000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "b131901200",
DFEventProperty.ITEM_NAME: "car",
DFEventProperty.ITEM_PRICE: 1000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0
]
let properties: [String: Any] = [
DFEventProperty.TOTAL_PURCHASE_AMOUNT: 2,
DFEventProperty.ORDER_ID: "a0b1c211",
DFEventProperty.PAYMENT_METHOD: "credit_card",
DFEventProperty.DELIVERY_CHARGE: 0.0,
DFEventProperty.DISCOUNT: 0.0,
DFEventProperty.ITEMS: [item1, item2]
]
Dfinery.shared().logEvent(DFEvent.PURCHASE, properties: properties)
Copy logEvent:(NSString * _Nonnull)
logEvent:(NSString * _Nonnull) withProperties:(NSDictionary<NSString *,id> * _Nonnull)
Each parameter means:
First parameter
: event name
properties
: event properties
Example usage
Copy // When recording only events
[[Dfinery shared] logEvent:DFEvent.LOGIN];
// When recording with event properties
[[Dfinery shared] logEvent:@"custom_event" properties:@{
@"custom_key": @"custom_value"
}];
// When recording all event properties and items
NSDictionary *item1 = @{
DFEventProperty.ITEM_ID: @"b1319000",
DFEventProperty.ITEM_NAME: @"apple",
DFEventProperty.ITEM_PRICE: @1000.0,
DFEventProperty.ITEM_QUANTITY: @1,
DFEventProperty.ITEM_DISCOUNT: @0.0
};
NSDictionary *item2 = @{
DFEventProperty.ITEM_ID: @"a8901200",
DFEventProperty.ITEM_NAME: @"car",
DFEventProperty.ITEM_PRICE: @600000.0,
DFEventProperty.ITEM_QUANTITY: @2
DFEventProperty.ITEM_DISCOUNT: @0.0
};
NSArray<NSDictionary *> *items = @[item1, item2];
NSDictionary *properties = @{
DFEventProperty.TOTAL_PURCHASE_AMOUNT: @2,
DFEventProperty.ORDER_ID: @"a0b1c211",
DFEventProperty.PAYMENT_METHOD: @"credit_card",
DFEventProperty.DELIVERY_CHARGE: @0.0,
DFEventProperty.DISCOUNT: @0.0,
DFEventProperty.ITEMS: items
};
[[Dfinery shared] logEvent:DFEvent.PURCHASE properties: properties];
Standard Events & Product Attributes
Standard events and standard event properties, product properties are as follows. They can also be used as event names.
Standard Events
For standard events, event and event property names are provided as predefined static constants as follows:
Constant
Event name
Notation name
DFEvent.VIEW_PRODUCT_DETAILS
DFEvent.VIEW_SEARCH_RESULT
Enter purchase information
Standard event properties
Constant
Event attribute name
Notation name
DFEventProperty.TOTAL_REFUND_AMOUNT
Total refund (cancellation) amount
DFEventProperty.DELIVERY_CHARGE
DFEventProperty.PAYMENT_METHOD
DFEventProperty.TOTAL_PURCHASE_AMOUNT
DFEventProperty.SHARING_CHANNEL
DFEventProperty.SIGN_CHANNEL
Product Attributes
Information about predefined property values for products loaded as an array in DFEventProperty.ITEMS. ITEM_ID, ITEM_NAME, ITEM_PRICE, ITEM_QUANTITY, ITEM_DISCOUNT are required values and must be included.
Constant
Event attribute name
Type
Explanation
Essential
DFEventProperty.ITEM_NAME
DFEventProperty.ITEM_PRICE
DFEventProperty.ITEM_QUANTITY
DFEventProperty.ITEM_DISCOUNT
DFEventProperty.ITEM_CATEGORY1
DFEventProperty.ITEM_CATEGORY2
DFEventProperty.ITEM_CATEGORY3
DFEventProperty.ITEM_CATEGORY4
DFEventProperty.ITEM_CATEGORY5
Example of using standard events
Log in
This event indicates that a user has signed up as a member of the service.
Swift Objective-C
Copy Dfinery.shared().logEvent(DFEvent.LOGIN)
Copy [[Dfinery shared] logEvent:DFEvent.LOGIN];
Log out
This event indicates that a user is logging out of the app.
Swift Objective-C
Copy Dfinery.shared().logEvent(DFEvent.LOGOUT)
Copy [[Dfinery shared] logEvent:DFEvent.LOGOUT];
Join the membership
This event indicates the action taken by a user to sign up as a member.
Swift Objective-C
Copy Dfinery.shared().logEvent(
DFEvent.SIGN_UP,
properties: [DFEventProperty.SIGN_CHANNEL: "Apple"]
)
Copy NSDictionary *signUpProperties = @{
@"DFEventProperty.SIGN_CHANNEL": @"Apple"
};
[[Dfinery shared] logEvent:@"DFEvent.SIGN_UP" properties:signUpProperties];
Standard event properties
Name
Type
Explanation
Essential
DFEventProperty.SIGN_CHANNEL
Purchase
An event that represents a user's action of purchasing a product or service.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "accessories"
]
let items = [item1, item2]
let properties: [String: Any] = [
DFEventProperty.TOTAL_PURCHASE_AMOUNT: 2,
DFEventProperty.ORDER_ID: "a001",
DFEventProperty.PAYMENT_METHOD: "credit_card",
DFEventProperty.DELIVERY_CHARGE: 0.0,
DFEventProperty.DISCOUNT: 0,
DFEventProperty.ITEMS: items
]
Dfinery.shared().logEvent(DFEvent.PURCHASE, properties: properties)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"accessories"
};
NSDictionary *purchaseProperties = @{
@"DFEventProperty.TOTAL_PURCHASE_AMOUNT": @2,
@"DFEventProperty.ORDER_ID": @"a001",
@"DFEventProperty.PAYMENT_METHOD": @"credit_card",
@"DFEventProperty.DELIVERY_CHARGE": @0.0,
@"DFEventProperty.DISCOUNT": @0.0,
@"DFEventProperty.ITEMS": @[item1, item2]
};
[[Dfinery shared] logEvent:@"DFEvent.PURCHASE" properties:purchaseProperties];
Standard event properties
Name
Type
Explanation
Essential
DFEventProperty.PAYMENT_METHOD
DFEventProperty.TOTAL_PURCHASE_AMOUNT
DFEventProperty.DELIVERY_CHARGE
View Home Screen
An event that indicates the user's action of viewing the app's home screen.
Swift Objective-C
Copy Dfinery.shared().logEvent(DFEvent.VIEW_HOME)
Copy [[Dfinery shared] logEvent:DFEvent.VIEW_HOME];
View product details
This event represents an action taken by a user to view detailed information about a specific product.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "Accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.VIEW_PRODUCT_DETAILS,
properties: [DFEventProperty.ITEMS: items]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"accessories"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.VIEW_PRODUCT_DETAILS withProperties:@{
DFEventProperty.ITEMS: items
}];
Standard event properties
Name
Type
Explanation
Essential
Put in a shopping cart
This event represents the action of a user adding a product to the shopping cart.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.ADD_TO_CART,
properties: [DFEventProperty.ITEMS: items]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"accessories"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.ADD_TO_CART withProperties:@{
DFEventProperty.ITEMS: items
}];
Standard event properties
Name
Type
Explanation
Essential
Put in a shopping cart
This event represents the action of a user adding a product to the shopping cart.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.ADD_TO_WISHLIST,
properties: [DFEventProperty.ITEMS: items]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"accessories"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.ADD_TO_WISHLIST withProperties:@{
DFEventProperty.ITEMS: items
}];
Standard event properties
Name
Type
Explanation
Essential
Add to Wishlist
This event represents the action taken by a user to add a product to their interest list.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 1500000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "accessories"
]
Dfinery.shared().logEvent(
DFEvent.REFUND,
properties: [
DFEventProperty.TOTAL_REFUND_AMOUNT: 1510000.0,
DFEventProperty.ITEMS: [item1, item2]
]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"accessories"
};
NSArray<NSDictionary *> *items = @[item1, item2];
NSDictionary *refundProperties = @{
@"DFEventProperty.TOTAL_REFUND_AMOUNT": @1510000.0,
@"DFEventProperty.ITEMS": items
};
[[Dfinery shared] logEvent:@"DFEvent.REFUND" properties:refundProperties];
Standard event properties
Name
Type
Explanation
Essential
DFEventProperty.TOTAL_REFUND_AMOUNT
Total refund (cancellation) amount
Search for products
This event represents the action of a user searching for a product and checking the results.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "Home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "Smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "Home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "Smartphone",
DFEventProperty.ITEM_CATEGORY5: "Accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.VIEW_SEARCH_RESULT,
properties: [
DFEventProperty.KEYWORD: "keyword",
DFEventProperty.ITEMS: items
]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"디지털",
@"DFEventProperty.ITEM_CATEGORY2": @"가전",
@"DFEventProperty.ITEM_CATEGORY3": @"전화기",
@"DFEventProperty.ITEM_CATEGORY4": @"스마트폰",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"디지털",
@"DFEventProperty.ITEM_CATEGORY2": @"가전",
@"DFEventProperty.ITEM_CATEGORY3": @"전화기",
@"DFEventProperty.ITEM_CATEGORY4": @"스마트폰",
@"DFEventProperty.ITEM_CATEGORY5": @"액세서리"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.VIEW_SEARCH_RESULT withProperties:@{
DFEventProperty.KEYWORD: @"keyword",
DFEventProperty.ITEMS: items
}];
Standard event properties
Name
Type
Explanation
Essential
Share this product
This event represents a user's action of sharing a product.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "Home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "Smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "Home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "Smartphone",
DFEventProperty.ITEM_CATEGORY5: "Accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.SHARE_PRODUCT,
properties: [
DFEventProperty.SHARING_CHANNEL: "sharing_channel",
DFEventProperty.ITEMS: items
]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"디지털",
@"DFEventProperty.ITEM_CATEGORY2": @"가전",
@"DFEventProperty.ITEM_CATEGORY3": @"전화기",
@"DFEventProperty.ITEM_CATEGORY4": @"스마트폰",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"디지털",
@"DFEventProperty.ITEM_CATEGORY2": @"가전",
@"DFEventProperty.ITEM_CATEGORY3": @"전화기",
@"DFEventProperty.ITEM_CATEGORY4": @"스마트폰",
@"DFEventProperty.ITEM_CATEGORY5": @"액세서리"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.SHARE_PRODUCT withProperties:@{
DFEventProperty.SHARING_CHANNEL: @"sharing_channel",
DFEventProperty.ITEMS: items
}];
Standard event properties
Name
Type
Explanation
Essential
DFEventProperty.SHARING_CHANNEL
View product list
This event indicates the user's action of viewing a product list.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "Home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "Smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "Home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "Smartphone",
DFEventProperty.ITEM_CATEGORY5: "Accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.VIEW_LIST,
properties: [DFEventProperty.ITEMS: items]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"디지털",
@"DFEventProperty.ITEM_CATEGORY2": @"가전",
@"DFEventProperty.ITEM_CATEGORY3": @"전화기",
@"DFEventProperty.ITEM_CATEGORY4": @"스마트폰",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"디지털",
@"DFEventProperty.ITEM_CATEGORY2": @"가전",
@"DFEventProperty.ITEM_CATEGORY3": @"전화기",
@"DFEventProperty.ITEM_CATEGORY4": @"스마트폰",
@"DFEventProperty.ITEM_CATEGORY5": @"액세서리"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.VIEW_LIST withProperties:@{
DFEventProperty.ITEMS: items
}];
Standard event properties
Name
Type
Explanation
Essential
View Cart
This event indicates the user's action of viewing the shopping cart.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.VIEW_CART,
properties: [DFEventProperty.ITEMS: items]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"accessories"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.VIEW_CART withProperties:@{
DFEventProperty.ITEMS: item
}];
Standard event properties
Name
Type
Explanation
Essential
Enter purchase information
This event represents the action of a user entering purchase information.
Copy Dfinery.shared().logEvent(DFEvent.ADD_PAYMENT_INFO)
Copy [[Dfinery shared] logEvent:DFEvent.ADD_PAYMENT_INFO];
Delete Cart
This event represents the action of a user removing a product from their shopping cart.
Swift Objective-C
Copy let item1: [String: Any] = [
DFEventProperty.ITEM_ID: "b1319000",
DFEventProperty.ITEM_NAME: "iPhone12",
DFEventProperty.ITEM_PRICE: 15000000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "apple"
]
let item2: [String: Any] = [
DFEventProperty.ITEM_ID: "a3219006",
DFEventProperty.ITEM_NAME: "Charger",
DFEventProperty.ITEM_PRICE: 10000.0,
DFEventProperty.ITEM_QUANTITY: 1,
DFEventProperty.ITEM_DISCOUNT: 0.0,
DFEventProperty.ITEM_CATEGORY1: "digital",
DFEventProperty.ITEM_CATEGORY2: "home appliances",
DFEventProperty.ITEM_CATEGORY3: "phone",
DFEventProperty.ITEM_CATEGORY4: "smartphone",
DFEventProperty.ITEM_CATEGORY5: "accessories"
]
let items = [item1, item2]
Dfinery.shared().logEvent(
DFEvent.REMOVE_CART,
properties: [DFEventProperty.ITEMS: items]
)
Copy NSDictionary *item1 = @{
@"DFEventProperty.ITEM_ID": @"b1319000",
@"DFEventProperty.ITEM_NAME": @"iPhone12",
@"DFEventProperty.ITEM_PRICE": @1500000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"apple"
};
NSDictionary *item2 = @{
@"DFEventProperty.ITEM_ID": @"a3219006",
@"DFEventProperty.ITEM_NAME": @"Charger",
@"DFEventProperty.ITEM_PRICE": @10000.0,
@"DFEventProperty.ITEM_QUANTITY": @1,
@"DFEventProperty.ITEM_DISCOUNT": @0.0,
@"DFEventProperty.ITEM_CATEGORY1": @"digital",
@"DFEventProperty.ITEM_CATEGORY2": @"home appliances",
@"DFEventProperty.ITEM_CATEGORY3": @"phone",
@"DFEventProperty.ITEM_CATEGORY4": @"smartphone",
@"DFEventProperty.ITEM_CATEGORY5": @"accessories"
};
NSArray<NSDictionary *> *items = @[item1, item2];
[[Dfinery shared] logEvent:DFEvent.REMOVE_CART withProperties:@{
DFEventProperty.ITEMS: items
}];
Standard event properties
Name
Type
Explanation
Essential
Custom Events
Before calling an event, make sure that the event name, properties, and data types set in the console match.
Swift Objective-C
If there is no event property
Copy Dfinery.shared().logEvent("YOUR_CUSTOM_EVENT")
If there is an event property
Copy Dfinery.shared().logEvent(
"CUSTOM_EVENT_WITH_PROPS",
properties: [
"count": 42,
"name": "jimmy"
]
)
If there is no event property
Copy [[Dfinery shared] logEvent:@"YOUR_CUSTOM_EVENT"];
If there is an event property
Copy [[Dfinery shared] logEvent:@"CUSTOM_EVENT_WITH_PROPS" withProperties:@{
@"count": @42,
@"name": @"jimmy"
}];