# Differentiating email and SMS event types

Some email and SMS activities have two events. Learn about their types and uses.

## One event, two records

Most activities for email and SMS are recorded as a single event in Airship. However, some are represented by two events:

* **Default** — These records are only for audience targeting when creating a message or [segment](https://www.airship.com/docs/reference/glossary/#segment). Like any other default event, they are available in your project automatically.

* **Custom** — Because the activities originate outside Airship's own SDKs, Airship records them as custom events. They can be used in, and appear in, all the same ways and locations as any other custom event.

   They require setup in your project before you can use them. See [Adding events to your project](https://www.airship.com/docs/guides/audience/events/adding/).

## Where to use each event type

Use default events for the following:

- Audience targeting and [segments](https://www.airship.com/docs/reference/glossary/#segment)
- Sequence message conditions — See [Trigger](https://www.airship.com/docs/guides/messaging/messages/sequences/create/create/#trigger) in *Create a Sequence*.

Use custom events for the following:

- The Custom Event automation trigger — See [Custom Event](https://www.airship.com/docs/guides/messaging/messages/sequences/triggers/#custom-event) in *Automation and Sequence triggers*.
- Automation cancellation events — See [Cancellation Events](https://www.airship.com/docs/guides/messaging/messages/sequences/create-automation/#cancellation-events) in *Create an Automation*.
- Sequence exit events — See [Exit events](https://www.airship.com/docs/guides/messaging/messages/sequences/create/outcomes/#exit-events) in *Sequence outcomes*.
- [Goals](https://www.airship.com/docs/reference/glossary/#goals)

Custom events also appear in [Performance Analytics](https://www.airship.com/docs/reference/glossary/#pa) as Dimensions and Measures. See [Email in Performance Analytics](https://www.airship.com/docs/guides/reports/analytics/email/) and [SMS in Performance Analytics](https://www.airship.com/docs/guides/reports/analytics/sms/). You can also use a dedicated Explore. See [Custom queries and reference for the Custom Events Explore](https://www.airship.com/docs/guides/reports/analytics/exploring/custom-events/).

The Custom Event trigger for Scenes and In-App Automations requires events tracked by the Airship SDKs, so it can't use email and SMS events, which come from delivery providers instead.

## Email events

The following are the default and custom event names for email activities:

| Activity | Default event | Custom event |
| --- | --- | --- |
| **Bounce** | `email_bounce` | `bounce` |
| **Click** | `email_click` | `click` |
| **Delay** | `email_delay` | `delay` |
| **Delivery** | `email_delivered` | `delivery` |
| **Initial open** | `initial_open` | `initial_open` |
| **Injection** | `email_injection` | `injection` |
| **Open** | `email_open` | `open` |
| **Unsubscribe** | `email_unsubscribe` | `unsubscribe` |
{class="table-col-1-30 table-col-2-35 table-col-3-35"}

When [adding the custom events to your project](https://www.airship.com/docs/guides/audience/events/adding/), use the values in the Custom event column.

For stream schemas and example payloads, see [Custom Email Events](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-email-events/) in the Real-Time Data Streaming API reference. For segmentation properties and paths, see [Email events](https://www.airship.com/docs/reference/data-collection/events/#email-events) in the *Events Reference*.

## SMS events

The following are the default and custom event names for SMS activities:

| Activity | Default event | Custom event |
| --- | --- | --- |
| **Aborted** | `sms_aborted` | `aborted` |
| **Deleted** | n/a | `deleted` |
| **Delivered** | `sms_delivered` | `delivered` |
| **Dispatched** | `sms_dispatched` | `dispatched` |
| **Expired** | `sms_expired` | `expired` |
| **Failed** | `sms_failed` | `failed` |
| **RCS read** | n/a | `read` |
| **Rejected** | `sms_rejected` | `rejected` |
| **Short link click** | `short_link_click` | n/a |
| **Undeliverable** | `sms_undeliverable` | `undeliverable` |
| **Unknown** | `sms_unknown` | `unknown` |
{class="table-col-1-30"}

When [adding the custom events to your project](https://www.airship.com/docs/guides/audience/events/adding/), use the values in the Custom event column.

For more on RCS read events, see [RCS event reporting](https://www.airship.com/docs/developer/api-integrations/sms/rcs/#rcs-event-reporting) in *RCS branded senders*. 

For stream schemas, see [SMS delivery report](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-sms-events/#delivery-report) in the Real-Time Data Streaming API reference. For segmentation properties and paths, see [SMS events](https://www.airship.com/docs/reference/data-collection/events/#sms-events) in the *Events Reference*.

## Differentiating custom events using properties

The Custom Event trigger, Sequence exit events, and Automation cancellation events all match by the exact string you enter. If your app or website sends its own custom event with the same name as one listed in [Email events](#email-events) or [SMS events](#sms-events), for example an app event named `click`, it matches both your event and the Airship-generated one.

Rename your own event to remove this ambiguity for all future use. If renaming isn't practical, such as with an established event already used elsewhere, you can filter the events by a property unique to the Airship-generated event, such as `link_url` for `click`.

When [adding the custom events to your project](https://www.airship.com/docs/guides/audience/events/adding/), you only need to add properties you will use in filters or [Handlebars](https://www.airship.com/docs/reference/glossary/#handlebars) personalization. For filtering steps, see the following:

- [Filtering custom events](https://www.airship.com/docs/guides/messaging/messages/sequences/triggers/#filtering-custom-events) for the Custom Event trigger in *Automation and Sequence triggers* — The same workflow applies to Automation [Cancellation events](https://www.airship.com/docs/guides/messaging/messages/sequences/create-automation/#cancellation-events).
- [Configuring exit events and optional continuation](https://www.airship.com/docs/guides/messaging/messages/sequences/create/outcomes/#configuring-exit-events-and-optional-continuation) in *Sequence outcomes*

### Email custom event properties

Refer to these properties when configuring [email custom events](#email-events):

| Custom event | Properties |
| --- | --- |
| `bounce` | `bounce_class`, `bounce_event_type`, `email`, `sender`, `subject` |
| `click` | `agent_family`, `device_brand`, `device_family`, `email`, `is_mobile`, `is_prefetched`, `link_name`, `link_url`, `os_family`, `os_version`, `sender`, `subject` |
| `delay` | `email`, `sender`, `subject` |
| `delivery` | `email`, `sender`, `subject` |
| `initial_open` | `agent_family`, `device_brand`, `device_family`, `email`, `is_mobile`, `is_prefetched`, `os_family`, `os_version`, `sender`, `subject` |
| `injection` | `email`, `sender`, `subject` |
| `open` | `agent_family`, `device_brand`, `device_family`, `email`, `is_mobile`, `is_prefetched`, `os_family`, `os_version`, `sender`, `subject` |
| `unsubscribe` | `unsubscribe_event_type` |
{class="table-col-1-20"}

All properties are strings, except `is_mobile` and `is_prefetched`, which take Boolean values.

These properties have specific values or behavior:
   - `is_prefetched` is always `false` on click events.
   - `link_name` is the [name you assigned to the link](https://www.airship.com/docs/guides/messaging/messages/content/email/email/#link-names).
   - `link_url` is the tracked URL the user selected.
   - `unsubscribe_event_type` is `link_unsubscribe` or `list_unsubscribe`. See [Unsubscribe events](https://www.airship.com/docs/guides/messaging/messages/content/email/email/#unsubscribe-events) in *Email content*.

Message identifiers such as push ID, group ID, and campaign category are available for event segmentation using the paths in the [Events Reference](https://www.airship.com/docs/reference/data-collection/events/#email-events). In Real-Time Data Streaming they appear on `triggering_push`, not in the custom event `properties` object you add here.

### SMS custom event properties

Refer to these properties when configuring [SMS custom events](#sms-events):

| Property | Type | Description |
| --- | --- | --- |
| `sender` | String | The number or short code the message originated from |
| `vendor` | String | The delivery service for the message |
| `vendorDeliveryId` | String | A unique identifier for the message from the SMS vendor |
| `error_code` | String | An error code from the short message service center, if applicable, for all custom events except `read` |
| `is_rcs` | Boolean | Whether the message was delivered as RCS |
| `recipient_country_code` | String | The country code of the message recipient, for `read` events |
| `number_of_message_parts` | Number | The number of message parts delivered, for `read` events |
{class="table-col-1-20 table-col-2-20"}

Any SMS custom event except `read` can also represent an MMS message. MMS shares the `sender`, `vendor`, `error_code`, and `is_rcs` properties above. MMS custom events also have the following properties:

| Property | Type | Description |
| --- | --- | --- |
| `carrier_id` | String | Identifies the carrier the message was sent through |
| `handset` | String | The profile of the handset that received the message, only present when `result_status` is `N102` |
| `result_code` | String | A status code from the vendor, if applicable |
| `result_status` | String | The delivery status of the message from the vendor |
| `sent_as` | String | Whether the MMS was delivered as MMS or as SMS |
| `tracking_Id` | String | An ID assigned by the delivery service, only available for CLX |
{class="table-col-1-20 table-col-2-20"}

For the full schema, see [SMS delivery report](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-sms-events/#delivery-report) in the Real-Time Data Streaming API reference. For the RCS read report schema, see [RCS read report](https://www.airship.com/docs/developer/rest-api/connect/schemas/custom-sms-events/#rcs-read-report) in the same reference.
