# Sherlock Destination

## Destination Info

* Accepts [Page](/docs/segment/connections/spec/page), [Alias](/docs/segment/connections/spec/alias), [Group](/docs/segment/connections/spec/group), [Identify](/docs/segment/connections/spec/identify), [Track](/docs/segment/connections/spec/track) calls.
* Refer to it as **Sherlock** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)

Sherlock is the first engagement scoring application for SaaS businesses who want to truly understand user engagement. Build an engagement algorithm and understand the engagement of your users, accounts and segments.

This integration is maintained by Sherlock. For questions or help with your integration, contact [Sherlock support](support@sherlockscore.com).

## Getting Started

1. From the Segment web app, click **Catalog**.
2. Search for "Sherock" in the Catalog, select it, and choose which of your sources to connect the destination to.
3. Enter your Sherlock API Key in the Segment UI.
4. Start sending data!

## Data Tracking

Sherlock's system processes data for all tracking calls with the following notes.

### Page and Screen

When Sherlock receives `page` calls, they record a `Viewed Page` event. Sherlock sets a `Viewed Page: Page Name` property on it with the `name` from the page call.

Similarly when Sherlock receives a `screen` call, they record a `Viewed Screen` event with a `Viewed Screen: Screen Name` property.

### Group

When Sherlock receives a `group` call, they record all traits specified for the group. They also assign a `Group ID` trait to to the user indicating membership.

### Alias

When they receive an `alias` call, they record an alias for the specified `userId` and `previousId`. Data under both names are then merged into a single record.

### Nested Objects and Arrays

Sherlock's system flattens nested property and trait values into key/value pairs. Consider an object:

```javascript
{
  "id": 42,
  "item": {
    "name": "Hat",
    "details": {
      "color": "red",
      "size": "small"
    }
  }
}
```

This would be flattened into pairs with keys for each path delimited by `.`:

```javascript
{
  "id": 42,
  "item.name": "Hat",
  "item.details.color": "red",
  "item.details.size": "small"
}
```

Array values are unsupported and ignored by Sherlock's system.

## Engage

You can send computed traits and audiences generated using [Engage](/docs/segment/engage) to this destination as a **user property**. To learn more about Engage, schedule a [demo](https://segment.com/contact/demo).

For user-property destinations, an [identify](/docs/segment/connections/spec/identify/) call is sent to the destination for each user being added and removed. The property name is the snake\_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property `order_completed_last_30days: true`. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to `false`.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

> \[!NOTE]
>
> Real-time audience syncs to Sherlock  may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

## Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

| Field   | Description                                                   | Required | Type   |
| ------- | ------------------------------------------------------------- | -------- | ------ |
| API Key | You may find your API Key on your Sherlock \`Settings\` page. | Yes      | string |
