# Rudderstack (legacy)

Set up Customer.io as a Rudderstack source, and use Reporting Webhooks to send email events from your workspace to any of Rudderstack’s destinations.

## How it works[](#how-it-works)

Rudderstack takes advantage of [reporting webhooks](#supported-events) when using Customer.io as a source. Rudderstack converts our webhooks to their event format.

*   A person’s `customer_id` (a legacy identifier for `id`) in Customer.io becomes their `userId` in Rudderstack.
*   If a person doesn’t have an `id`, Rudderstack sets a person’s `email` address as an `anonymousId`.

```json
{
   "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ",
   "object_type": "email",
   "timestamp": 1613063089,
   "metric": "opened",
   "data": {
      "trigger_id": 1,
      "customer_id": "42",
      "delivery_id": "ZAIAAVTJVG0QcCok0-0ZKj6yiQ==",
      "action_id": 96,
      "broadcast_id": 2,
      "journey_id": "01GW20GXAAXBKZD8J96M8FNV3R",
      "parent_action_id": 1,
      "identifiers": {
         "id": "42",
         "email": "test@example.com",
         "cio_id": "d9c106000001"
      },
      "content": "string",
      "subject": "string",
      "recipient": "test@example.com"
   }
}
```

## Set up[](#set-up)

1.  Go to Rudderstack and click **Add Source**.
    
2.  Select **CustomerIO** from the list of *Event Stream* sources.
    
    [![Customer.io source in RudderStack](https://docs.customer.io/images/rudderstack-sources.png)](#55554161c445811604e28d1a20560426-lightbox)
    
3.  Assign a *Name* for your source and click **Next**. To connect this source to a RudderStack warehouse destination, the source name should match the name of your warehouse schema. Note the source **Write key**: you’ll need this key for your reporting webhook URL.
    
4.  In Customer.io, go to **Data & Integrations** > **Integrations** and find the **Reporting Webhooks** integration.
    
    [![Customer.io reporting webhooks](https://docs.customer.io/images/Reporting%20Webhooks%20Catalog%20Item.png)](#40e66b7738a3477a075e950f73b7b57c-lightbox)
    
5.  Click **Add Reporting Webhook** and add the webhook URL from the *Source Settings* page in your RudderStack dashboard. Make sure you add your source’s *write key* as query parameter to the URL. See [Rudderstack’s documentation](https://www.rudderstack.com/docs/get-started/rudderstack-open-source/data-plane-setup/#what-is-a-data-plane-url-where-do-i-get-it) for more information about the data plane URL.
    
    [![Find your rudderstack webhook URL](https://docs.customer.io/images/rudderstack-webhook-url.png)](#44660242c5454c3bc4ead508d330944d-lightbox)
    
6.  Select the events that you want to send to Rudderstack. Rudderstack *only* supports the following **Email Events**:
    
    Delivered
    
    The delivery provider reported that the email was delivered to the recipient’s inbox.
    
    Opened
    
    A recipient opened an email.
    
    Clicked
    
    A recipient clicked a tracked link in an email.
    
    Bounced
    
    The delivery provider reported that it was unable to deliver an email to a recipient.
    
    Spammed
    
    A recipient marked an email as spam.
    
    Unsubscribed
    
    A recipient unsubscribed via a particular email.
    
    [![Select the events that you want to forward to a destination through Rudderstack](https://docs.customer.io/images/rudderstack-webhook-events.png)](#3d72bf2ee2f38d4eaba1ca31f533f1f6-lightbox)
    
7.  Click **Save and Enable Webhook**.
    

### Supported events[](#supported-events)

RudderStack only supports the following email events.

Email Event

Description

`Delivered`

The delivery provider reported that the email was delivered to the recipient’s inbox.

`Opened`

A recipient opened an email.

`Clicked`

A recipient clicked a tracked link in an email.

`Bounced`

The delivery provider reported that it was unable to deliver an email to a recipient.

`Spammed`

A recipient marked an email as spam.

`Unsubscribed`

A recipient unsubscribed via a particular email.