Event
Before you start
Event Log
func logEvent(_ name: String)
func logEvent(_ name: String, properties: [String: Any])// 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)Standard Events & Product Attributes
Standard Events
Constant
Event name
Notation name
Standard event properties
Constant
Event attribute name
Notation name
Product Attributes
Constant
Event attribute name
Type
Explanation
Essential
Example of using standard events
Log in
Log out
Join the membership
Standard event properties
Name
Type
Explanation
Essential
Purchase
Standard event properties
Name
Type
Explanation
Essential
View Home Screen
View product details
Standard event properties
Name
Type
Explanation
Essential
Put in a shopping cart
Standard event properties
Name
Type
Explanation
Essential
Put in a shopping cart
Standard event properties
Name
Type
Explanation
Essential
Add to Wishlist
Standard event properties
Name
Type
Explanation
Essential
Search for products
Standard event properties
Name
Type
Explanation
Essential
Share this product
Standard event properties
Name
Type
Explanation
Essential
View product list
Standard event properties
Name
Type
Explanation
Essential
View Cart
Name
Type
Explanation
Essential
Enter purchase information
Delete Cart
Standard event properties
Name
Type
Explanation
Essential
Custom Events
Last updated