# Variance 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 **Variance** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)
* This integration is **partner owned.** Please reach out to the partner's support for any issues.

[Variance](https://variance.com?utm_source=segmentio\&utm_medium=docs\&utm_campaign=partners) hooks into your customer data and makes it easy to access growth signals across product, marketing, and sales. The platform provides your growth team with clear, intent-based signals, from all stages of a customer's journey.

This destination is maintained by Variance. For any issues with the destination, [contact the Variance Support team](mailto:support@variance.com).

## Getting Started

1. From the Destinations catalog page in the Segment App, click **Add Destination**.
2. Search for "Variance" in the Destinations Catalog, and select the Variance destination.
3. Choose which Source should send data to the Variance destination.
4. Go to the [Variance Integrations page](http://app.variance.com/integrations) (you'll see it in the main nav under your company name).
5. Click **Add Connection**.
6. Give your connection a name. If you use a descriptive name, you can use it as an event filter in Variance.
7. Choose a method for account matching. You can read more about these methods in the [Account Mapping](#account-mapping) section.
8. Find and copy the "Secret" and "Webhook URL" fields associated with this project.
9. Back in the Segment App, enter these as the **API Key** and **Webhook URL** fields in the Variance Destination settings.

## Supported methods

Variance supports the following methods of the [Segment Spec](/docs/segment/connections/spec).

### Page

If you aren't familiar with the Segment Spec, take a look at the [Page method documentation](/docs/segment/connections/spec/page/) to learn about what it does. An example call would look like:

```js
analytics.page()
```

Segment sends Page calls to Variance as a `Page` Event Type.

### Screen

If you aren't familiar with the Segment Spec, take a look at the [Screen method documentation](/docs/segment/connections/spec/screen/) to learn about what it does. An example call would look like:

```objc
[[SEGAnalytics sharedAnalytics] screen:@"Home"];
```

Segment sends Screen calls to Variance as a `Screen` Event Type.

### Identify

If you aren't familiar with the Segment Spec, take a look at the [Identify method documentation](/docs/segment/connections/spec/identify/) to learn about what it does. An example call would look like:

```js
analytics.identify('userId123', {
  email: 'john.doe@example.com'
});
```

Segment sends Identify calls to Variance as a `Contact`.

### Track

If you aren't familiar with the Segment Spec, take a look at the [Track method documentation](/docs/segment/connections/spec/track/) to learn about what it does. An example call would look like:

```js
analytics.track('Login Button Clicked')
```

Segment sends Track calls to Variance as an `Action` Event Type.

### Group

Send [Group](/docs/segment/connections/spec/group) to Variance. For example:

```js
analytics.group("groupId123", {
  name: "Initech",
  industry: "Technology",
  employees: 329,
  plan: "enterprise"
});
```

Segment sends Group calls to Variance as an `Account` if you've chosen the "Group" Account Mapping method during setup.

### Alias

If you're not familiar with the Segment Spec, take a look at the [Alias method documentation](/docs/segment/connections/spec/alias/) to learn about what it does. An example call would look like this:

```js
analytics.alias('123456')
```

If there is an existing user with that `userId` in Variance that matches the `previousId` passed with the alias, that user will be merged into the "123456" user identified in the alias. If there is only one user with the `previousId` and no user with the `userId`, that user will have their Variance `externalId` updated to match the current `userId` passed in the alias.

## Account Mapping

Variance offers several ways to map your users to accounts or companies, including the following.

* **Group**: If you already use the Group call to indicate the Account, then you don't need to change anything as Segment automatically extracts the Account name.
* **Identify with custom traits** (for example `company.id` and `company.name`): Choose this option if you include some information about the Account, Company, or Organization as a trait in each Identify call. When you choose this option, add the name of the trait you use. For example, if you configure the call with the data `{'company':{'id':1,'name':'Awesome Inc.'}}`, add `company.id` as the Account ID trait and `company.name` as the Account Name trait.
* **Identify email trait domain extraction** (Fallback option): If you don't use the methods above, Segment extracts the domain name from the `email` trait, and uses that value as the Account name.

> \[!NOTE]
>
> If none of these methods work for your configuration, [contact Variance support](mailto:support@variance.com) to discuss alternatives.

## 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 Variance  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     | Secret key from Variance. Found in the Integrations section under connection settings.  | Yes      | string |
| Webhook URL | Webhook URL from Variance. Found in the Integrations section under connection settings. | Yes      | string |
