# Koala Cloud Mode Integration

After you have successfully instrumented Koala as a destination in RudderStack, follow this guide to correctly send your events to Koala in [cloud mode]({{< ref "/destinations/rudderstack-connection-modes.md#cloud-mode" >}}).

Find the open source transformer code for this destination in the [GitHub repository](https://github.com/rudderlabs/rudder-transformer/tree/main/src/cdk/v2/destinations/koala).

{{< info >}}
Note the following when sending [`identify`](#identify) and [`track`](#track) events to Koala:

- You must include either `email` or the user's Koala profile id (`ko_profile_id`) as Koala uses one of these fields to associate the user with their profile.
- Send the `ko_profile_id` in the UUID v4 format.
{{< /info >}}

## Identify

You can use the [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call to create or update a Lead object in Koala.

A sample `identify` call is shown:

```javascript
rudderanalytics.identify("1hKOmRA4GRlm", {
  name: "Alex Keener",
  email: "alex@example.com",
  ko_profile_id: "12345"
})
```

### Supported mappings

RudderStack maps the following `identify` fields to the corresponding Koala properties:

| RudderStack property | Koala property | 
| :----| :----| 
| `traits.email` <br /> `context.traits.email` <br />  `properties.email` <br/> <span style="color: #4D4DFF;font-size:12px;">Required, if `ko_profile_id` is absent.</span> | `email` |
| `traits.ko_profile_id` <br /> `context.traits.ko_profile_id` <br /> `properties.ko_profile_id` <br/> <span style="color: #4D4DFF;font-size:12px;">Required, if `email` is absent.</span> | `profile_id` | 
| `type` | `identifies.$.type` | 
| `traits` <br /> `context.traits` | `events.$.traits` |
| `timestamp` <br /> `originalTimeStamp` | `events.$.sent_at` |

## Track

You can use the [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call to capture events like `Account Created`, `Account Deleted`, and their related properties.

```javascript
rudderanalytics.track("User Signed Up", {
  plan: "Pro Annual",
  firstName: "Alex",
  lastName: "Keener",
  ko_profile_id: "12345"
  email: "alex@example.com"
})
```

### Supported mappings

RudderStack maps the following `track` fields to the corresponding Koala properties:

| RudderStack property | Koala property | 
| :----| :----| 
| `event` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `events.$.event` |
| `traits.email` <br/> `context.traits_email`<br/> `properties.email` <br/> <span style="color: #4D4DFF;font-size:12px;">Required, if `ko_profile_id` is absent.</span> | `email` |
| `traits.ko_profile_id` <br/> `context.traits.ko_profile_id`<br /> `properties.ko_profile_id` <br/> <span style="color: #4D4DFF;font-size:12px;">Required, if `email` is absent.</span> | `profile_id` | 
| `context.ip` <br /> `request_ip` | `ip` |
| `context` | `event.$.context` |
| `properties` | `events.$.properties` |
| `type` | `events.$.type` |
| `messageId` | `events.$.message_id` |
| `timestamp` <br /> `originalTimeStamp` | `events.$.sent_at` |

