# Event

How to record user events using the DFINERY SDK. [SDK integration](https://docs.dfinery.ai/developer-guide/en/undefined-1/ios/integration) must be done first.

### Before you start <a href="#undefined" id="undefined"></a>

Before recording an event, please register the event in [the DFINERY console](https://console.dfinery.ai/) and then link it. You can register an event in the console's Additional Settings / Data Linkage / Event Management / Event List.

{% hint style="danger" %}
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.
{% endhint %}

## Event Log

Log an event by calling one of the following `logEvent` methods. The [standard events](https://docs.dfinery.ai/developer-guide/en/undefined-1/ios/event#predefinded_event) provide constants.

{% tabs %}
{% tab title="Swift" %}
```swift
func logEvent(_ name: String)
    
func logEvent(_ name: String, properties: [String: Any])
```

Each parameter means:

* `name` : event name
* `properties` : event properties

Example usage

```swift
// 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)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
logEvent:(NSString * _Nonnull)

logEvent:(NSString * _Nonnull) withProperties:(NSDictionary<NSString *,id> * _Nonnull)
```

Each parameter means:

* `First parameter` : event name
* `properties` : event properties

Example usage

```objective-c
// 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];
```
{% endtab %}
{% endtabs %}

### Standard Events & Product Attributes <a href="#and" id="and"></a>

Standard events and standard event properties, product properties are as follows. They can also be used as event names.

#### Standard Events <a href="#predefinded_event" id="predefinded_event"></a>

For standard events, event and event property names are provided as predefined static constants as follows:

| Constant                       | Event name                 | Notation name              |
| ------------------------------ | -------------------------- | -------------------------- |
| `DFEvent.LOGIN`                | df\_login                  | log in                     |
| `DFEvent.LOGOUT`               | df\_logout                 | log out                    |
| `DFEvent.SIGN_UP`              | df\_sign\_up               | Join 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

| Constant                                | Event attribute name        | Notation name                      |
| --------------------------------------- | --------------------------- | ---------------------------------- |
| `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 <a href="#item_property" id="item_property"></a>

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_ID`        | df\_item\_id         | String | Product Number (ID)    | ✅         |
| `DFEventProperty.ITEM_NAME`      | df\_item\_name       | String | Product Name           | ✅         |
| `DFEventProperty.ITEM_PRICE`     | df\_price            | Double | Product unit price     | ✅         |
| `DFEventProperty.ITEM_QUANTITY`  | df\_quantity         | Int    | Product Quantity       | ✅         |
| `DFEventProperty.ITEM_DISCOUNT`  | df\_discount         | Double | 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     |           |

{% hint style="info" %}
There is no need to call the df\_start\_session and df\_end\_session events as they are automatically collected by the SDK.
{% endhint %}

### Example of using standard events <a href="#undefined-4" id="undefined-4"></a>

#### Log in <a href="#undefined-5" id="undefined-5"></a>

This event indicates that a user has signed up as a member of the service.

{% tabs %}
{% tab title="Swift" %}
```swift
Dfinery.shared().logEvent(DFEvent.LOGIN)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
[[Dfinery shared] logEvent:DFEvent.LOGIN];
```
{% endtab %}
{% endtabs %}

#### Log out <a href="#undefined-7" id="undefined-7"></a>

This event indicates that a user is logging out of the app.

{% tabs %}
{% tab title="Swift" %}
```swift
Dfinery.shared().logEvent(DFEvent.LOGOUT)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
[[Dfinery shared] logEvent:DFEvent.LOGOUT];
```
{% endtab %}
{% endtabs %}

#### Join the membership <a href="#undefined-9" id="undefined-9"></a>

This event indicates the action taken by a user to sign up as a member.

{% tabs %}
{% tab title="Swift" %}
```swift
Dfinery.shared().logEvent(
    DFEvent.SIGN_UP,
    properties: [DFEventProperty.SIGN_CHANNEL: "Apple"]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
NSDictionary *signUpProperties = @{
    @"DFEventProperty.SIGN_CHANNEL": @"Apple"
};

[[Dfinery shared] logEvent:@"DFEvent.SIGN_UP" properties:signUpProperties];
```
{% endtab %}
{% endtabs %}

#### Standard event properties

| Name                           | Type   | Explanation        | Essential |
| ------------------------------ | ------ | ------------------ | --------- |
| `DFEventProperty.SIGN_CHANNEL` | String | Membership Channel | ✅         |

### Purchase

An event that represents a user's action of purchasing a product or service.

{% tabs %}
{% tab title="Swift" %}
```swift
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)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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];
```
{% endtab %}
{% endtabs %}

#### **Standard event properties**

| Name                                    | Type   | Explanation                                                                             | Essential |
| --------------------------------------- | ------ | --------------------------------------------------------------------------------------- | --------- |
| `DFEventProperty.ITEMS`                 | Array  | [Goods](https://docs.dfinery.ai/developer-guide/en/undefined-1/ios/event#item_property) | ✅         |
| `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 <a href="#undefined-15" id="undefined-15"></a>

An event that indicates the user's action of viewing the app's home screen.

{% tabs %}
{% tab title="Swift" %}
```swift
    Dfinery.shared().logEvent(DFEvent.VIEW_HOME)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
[[Dfinery shared] logEvent:DFEvent.VIEW_HOME];
```
{% endtab %}
{% endtabs %}

#### View product details <a href="#undefined-17" id="undefined-17"></a>

This event represents an action taken by a user to view detailed information about a specific product.

{% tabs %}
{% tab title="Swift" %}
```swift
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]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

#### **Standard event properties**

| Name                    | Type  | Explanation                                                                             | Essential |
| ----------------------- | ----- | --------------------------------------------------------------------------------------- | --------- |
| `DFEventProperty.ITEMS` | Array | [Goods](https://docs.dfinery.ai/developer-guide/en/undefined-1/ios/event#item_property) | ✅         |

#### Put in a shopping cart <a href="#undefined-20" id="undefined-20"></a>

This event represents the action of a user adding a product to the shopping cart.

{% tabs %}
{% tab title="Swift" %}
```swift
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]
)

```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

#### Standard event properties

| Name                    | Type  | Explanation                                                                             | Essential |
| ----------------------- | ----- | --------------------------------------------------------------------------------------- | --------- |
| `DFEventProperty.ITEMS` | Array | [Goods](https://docs.dfinery.ai/developer-guide/en/undefined-1/ios/event#item_property) | ✅         |

#### Put in a shopping cart <a href="#undefined-20" id="undefined-20"></a>

This event represents the action of a user adding a product to the shopping cart.

{% tabs %}
{% tab title="Swift" %}
```swift
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]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

#### **Standard event properties**

| Name                    | Type  | Explanation                                                                             | Essential |
| ----------------------- | ----- | --------------------------------------------------------------------------------------- | --------- |
| `DFEventProperty.ITEMS` | Array | [goods](https://docs.dfinery.ai/developer-guide/en/undefined-1/ios/event#item_property) | ✅         |

#### Add to Wishlist <a href="#undefined-23" id="undefined-23"></a>

This event represents the action taken by a user to add a product to their interest list.

{% tabs %}
{% tab title="Swift" %}
```swift
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]
    ]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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];
```
{% endtab %}
{% endtabs %}

#### Standard event properties

| Name                                  | Type   | Explanation                        | Essential |
| ------------------------------------- | ------ | ---------------------------------- | --------- |
| `DFEventProperty.ITEMS`               | Array  | [goods](#item_property)            | ✅         |
| `DFEventProperty.TOTAL_REFUND_AMOUNT` | Double | Total refund (cancellation) amount | ✅         |

### Search for products

This event represents the action of a user searching for a product and checking the results.

{% tabs %}
{% tab title="Swift" %}
```swift
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
    ]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

#### Standard event properties

| Name                      | Type   | Explanation             | Essential |
| ------------------------- | ------ | ----------------------- | --------- |
| `DFEventProperty.ITEMS`   | Array  | [goods](#item_property) | ✅         |
| `DFEventProperty.KEYWORD` | String | Search Keywords         | ✅         |

### Share this product

This event represents a user's action of sharing a product.

{% tabs %}
{% tab title="Swift" %}
```swift
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
    ]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

#### Standard event properties

| Name                              | Type   | Explanation             | Essential |
| --------------------------------- | ------ | ----------------------- | --------- |
| `DFEventProperty.ITEMS`           | Array  | [goods](#item_property) | ✅         |
| `DFEventProperty.SHARING_CHANNEL` | String | Product sharing channel | ✅         |

### View product list

This event indicates the user's action of viewing a product list.

{% tabs %}
{% tab title="Swift" %}
```swift
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]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

#### **Standard event properties**

| Name                    | Type  | Explanation             | Essential |
| ----------------------- | ----- | ----------------------- | --------- |
| `DFEventProperty.ITEMS` | Array | [goods](#item_property) | ✅         |

#### View Cart <a href="#undefined-38" id="undefined-38"></a>

This event indicates the user's action of viewing the shopping cart.

{% tabs %}
{% tab title="Swift" %}
```swift
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]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

Standard event properties

| Name                    | Type  | Explanation             | Essential |
| ----------------------- | ----- | ----------------------- | --------- |
| `DFEventProperty.ITEMS` | Array | [goods](#item_property) | ✅         |

#### Enter purchase information <a href="#undefined-41" id="undefined-41"></a>

This event represents the action of a user entering purchase information.

```swift
Dfinery.shared().logEvent(DFEvent.ADD_PAYMENT_INFO)
```

```objective-c
[[Dfinery shared] logEvent:DFEvent.ADD_PAYMENT_INFO];
```

#### Delete Cart <a href="#undefined-42" id="undefined-42"></a>

This event represents the action of a user removing a product from their shopping cart.

{% tabs %}
{% tab title="Swift" %}
```swift
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]
)
```
{% endtab %}

{% tab title="Objective-C" %}
```objective-c
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
}];
```
{% endtab %}
{% endtabs %}

#### **Standard event properties**

| Name                    | Type  | Explanation                                                                             | Essential |
| ----------------------- | ----- | --------------------------------------------------------------------------------------- | --------- |
| `DFEventProperty.ITEMS` | Array | [goods](https://docs.dfinery.ai/developer-guide/en/undefined-1/ios/event#item_property) | ✅         |

### Custom Events <a href="#undefined-45" id="undefined-45"></a>

Here is an example of calling a custom event created in [the DFINERY console](https://console.dfinery.ai/) that is not predefined in DFINERY.

{% hint style="warning" %}
Before calling an event, make sure that the event name, properties, and data types set in the console match.
{% endhint %}

{% tabs %}
{% tab title="Swift" %}
**If there is no event property**

```swift
Dfinery.shared().logEvent("YOUR_CUSTOM_EVENT")
```

**If there is an event property**

```swift
Dfinery.shared().logEvent(
    "CUSTOM_EVENT_WITH_PROPS", 
    properties: [
        "count": 42, 
        "name": "jimmy"
    ]
)
```
{% endtab %}

{% tab title="Objective-C" %}
**If there is no event property**

```objective-c
[[Dfinery shared] logEvent:@"YOUR_CUSTOM_EVENT"];
```

**If there is an event property**

```objective-c
[[Dfinery shared] logEvent:@"CUSTOM_EVENT_WITH_PROPS" withProperties:@{
    @"count": @42, 
    @"name": @"jimmy"
}];
```
{% endtab %}
{% endtabs %}
