# Vero Cloud Mode Integration

RudderStack lets you send your event data to Vero via [cloud mode]({{< ref "destinations/rudderstack-connection-modes.md#cloud-mode" >}}).

Find the open source transformer code for this destination in the <a href="https://github.com/rudderlabs/rudder-transformer/tree/main/src/v0/destinations/vero">GitHub repository</a>.

## Identify

The [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call lets you identify a user and associate them to their actions. It also lets you record any traits about them like their name, email, etc.

RudderStack sends the `identify` events to Vero via their [`users`](https://developers.getvero.com/?bash#users) endpoint to create, update, and manage your user records and their subscription status.

A sample `identify` call is shown below:

```javascript
rudderanalytics.identify("1hKOmRA4GRlm", {
  "email": "alex@example.com",
  "gender": "Male",
  "randomKey": "randomData"
})
```

### Supported mappings

The following table lists the mapping of the RudderStack traits to the corresponding Vero properties:

| RudderStack trait | Vero property | Presence |
| :-----| :------| :-------|
| `userId` or `anonymousId` | `id` | Required. |
| `email` | `email` | Optional |
| `traits` | `data` |  Optional |
| `context.os.name` | `channels.platform` | Optional |
| `context.device.token` | `channels.address` | Optional |
| `context.device.name` | `channels.device` | Optional |
| `context.timezone` | `timezone` | Optional |
| `context.locale`| `locale` | Optional |
| `context.userAgent` | `userAgent` | Optional |

{{< info >}}
`email` is an optional field. However, if it is absent, Vero will not be able to send any emails to the user, so it is recommended to have this trait in the event.
{{< /info >}}

{{< info >}}
If `userId` is absent, RudderStack maps `anonymousId` to Vero's `id` field to create or update the user.
{{< /info >}}

{{< success >}}
You can add or update user records as required as these are the custom properties.
{{< /success >}}

## Track

The [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call lets you capture user events along with the properties associated with them.

RudderStack sends the `track` events to Vero via their [`events/track`](https://developers.getvero.com/?bash#events-track) endpoint to track events for a specific user based on the actions they take. If a user profile does not exist, Vero will create one.

A sample `track` event is as shown:

```javascript
rudderanalytics.track("Product Viewed", {
  SKU: "P001",
  "revenue": 77.6,
  "currency": "USD",
  "review_id": "R1619"
})
```

{{< info >}}
Vero does not differentiate between the upper or lower case letters, spaces, and underscores in the event names. For example, Vero matches the `Purchased Item`, `purchased item`, and `purchased_item` as the same event.
{{< /info >}}

### Supported mappings

The following table lists the mapping of the RudderStack properties to the corresponding Vero properties:

| RudderStack property | Vero property | Presence |
| :-----| :------| :-------|
| `userId`/`anonymousId` | `identity.id` | Required |
| `event`  | `event_name` | Required |
| `email` | `identity.email` | Optional |
| `properties` | `data` | Optional |

### Unsubscribing and resubscribing users

RudderStack supports [unsubscribing](https://developers.getvero.com/?bash#users-unsubscribe) and [resubscribing](https://developers.getvero.com/?bash#users-resubscribe) users in Vero by passing the `userId` in the `track` call:

```javascript
rudderanalytics.track("unsubscribe", {
  userId: "1hKOmRA4el9Zt1WSfVJIVo4GRlm"
})
```

## Page

The [`page`]({{< ref "event-spec/standard-events/page.md" >}}) call lets you record your website's page views with any additional relevant information about the viewed page.

RudderStack sends the `page` events to Vero via their [`events/track`](https://developers.getvero.com/?bash#events-track) endpoint.

A sample `page` call is shown below:

```javascript
rudderanalytics.page(
  "Cart",
  "Cart Viewed", {
    path: "/best-seller/1",
    referrer: "https://www.google.com/search?q=estore+bestseller",
    search: "estore bestseller",
    title: "The best sellers offered by EStore",
    url: "https://www.estore.com/best-seller/1"
  }
);
```

## Screen

The [`screen`]({{< ref "event-spec/standard-events/screen.md" >}}) call lets you record whenever your user views their mobile screen, with any additional relevant information about the screen.

RudderStack sends the `screen` events to Vero via their [`events/track`](https://developers.getvero.com/?bash#events-track) endpoint.

A sample `screen` call sent via the [Android (Java) SDK]({{< ref "sources/event-streams/sdks/rudderstack-android-sdk/_index.md" >}}) is as shown:

```kotlin
MainApplication.rudderClient.screen(
    "Home Screen",
    RudderProperty().putValue("prop_key", "prop_value")
)
```

## Alias

RudderStack sends the [`alias`]({{< ref "event-spec/standard-events/alias.md" >}}) events to Vero via their [`users/reidentify`](https://developers.getvero.com/?bash#users-alias) endpoint to change a user's identifier (`id`).

A sample `alias` call is shown below:

```javascript
rudderanalytics.alias("userId", "previousId");
```

### Supported mappings

The following table lists the mapping of the RudderStack properties to the corresponding Vero properties:

| RudderStack property | Vero property | Presence |
| :-----| :------| :-------|
| `userId` | `new_id` | Required |
| `previousId` | `id` | Required |

## Adding and removing tags

RudderStack supports adding and removing `tags` to all `identify`, `track`, `page`,  and `screen` calls by passing them via the `integrations` object. An example snippet is shown below:

```javascript
rudderanalytics.identify(
  "1hKOmRA4GRlm", {
    email: "alex@example.com"
  }, {
    integrations: {
      Vero: {
        tags: {
          add: ["tag1", "tag2"],
          remove: ["tag3"]
        }
      }
    }
  }
);
```

You can then view the updated tags associated with that user in the Vero dashboard:

{{< image src="images/event-stream-destinations/vero-tags.webp" alt="User tags in Vero dashboard" >}}



