# Survicate (Actions) 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 **Survicate (Actions)** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)
* This destination is not compatible with [Destination Insert Functions.](/docs/segment/connections/functions/insert-functions/)
* This integration is **partner owned.** Please reach out to the partner's support for any issues.

[Survicate](https://survicate.com/integrations/segment-survey/?utm_source=segment\&utm_medium=referral) is a complete toolkit for customer feedback.

This destination is maintained by Survicate. For any issues with the destination, [contact the Survicate Support team](mailto:help@survicate.com).

## Getting started

1. From the Segment web app, click **Destinations**.
2. Search for "Survicate (Actions)" in the Catalog, select it, and choose which of your sources to connect the destination to.
3. Enter the "Workspace Key" into your Segment Settings UI which you can find from your [Survicate Workspace Settings](https://panel.survicate.com/o/0/w/0/settings/web-surveys).

## Destination Settings

| Field         | Description                                   | Required | Type   |
| ------------- | --------------------------------------------- | -------- | ------ |
| Workspace Key | The workspace key for your Survicate account. | Yes      | string |

## Available Presets

Survicate (Actions) has the following presets

| Preset Name    | Trigger                 | Default Action |
| -------------- | ----------------------- | -------------- |
| Identify User  | Event type = "identify" | Identify User  |
| Identify Group | Event type = "group"    | Identify Group |
| Track Event    | Event type = "track"    | Track Event    |

## Available Actions

Build your own Mappings. Combine supported [triggers](/docs/segment/connections/destinations/actions/#components-of-a-destination-action) with the following Survicate-supported actions:

> \[!NOTE]
>
> Individual destination instances have support a maximum of 50 mappings.

* [Track Event](#track-event-10)
* [Identify Group](#identify-group)
* [Identify User](#identify-user-7)

### Track Event

Invoke survey with Segment Track event

Track Event is a **Web** action. The default Trigger is `type = "track"`

| Field            | Description                                   | Required | Type   |
| ---------------- | --------------------------------------------- | -------- | ------ |
| Event name       | The event name                                | Yes      | STRING |
| Event Properties | Object containing the properties of the event | No       | OBJECT |

### Identify Group

Send group traits to Survicate

Identify Group is a **Web** action. The default Trigger is `type = "group"`

| Field    | Description                                      | Required | Type   |
| -------- | ------------------------------------------------ | -------- | ------ |
| Group ID | The Segment groupId to be forwarded to Survicate | Yes      | STRING |
| Traits   | The Segment traits to be forwarded to Survicate  | Yes      | OBJECT |

### Identify User

Set visitor traits with Segment Identify event

Identify User is a **Web** action. The default Trigger is `type = "identify"`

| Field  | Description                                     | Required | Type   |
| ------ | ----------------------------------------------- | -------- | ------ |
| Traits | The Segment traits to be forwarded to Survicate | Yes      | OBJECT |

## Identify

If you're not familiar with the Segment Specs, take a look to understand what the [Identify method](/docs/segment/connections/spec/identify/) does. An example call would look like:

```text
analytics.identify('userId123', {
  email: 'john.doe@example.com',
  jobTitle: 'CEO',
  companySize: '50'
});
```

When you call Identify, we pass Segment traits as respondents' attributes to Survicate. They can be used to trigger web surveys or filter survey results.

All traits passed in Identify calls will be available in Survicate - once you view a respondent profile or export survey data.

All `camelCase` attribute keys are translated to `snake_case`.

All *object attributes* will be flattened to attributes prefixed by object key. All *array attributes* will be omitted.

```text
analytics.identify('1234', {
    address: {
        street: '6th St',
        city: 'San Francisco',
        state: 'CA',
        postalCode: '94103',
        country: 'USA'
    },
    categories: ['startup','SaaS']
});
```

The above described call creates following respondent's traits in Survicate:

| key                   | value         |
| --------------------- | ------------- |
| id                    | 1234          |
| address\_street       | 6th St        |
| address\_city         | San Francisco |
| address\_state        | CA            |
| address\_postal\_code | 94103         |
| address\_country      | USA           |

*Categories* attribute is omitted as it is an array attribute.

## Group

If you're not familiar with the Segment Specs, take a look to understand what the [Group method](/docs/segment/connections/spec/group/) does. An example call would look like:

```text
analytics.group('group123', {
  name: 'Company Inc.'
});
```

All Group traits will be passed to respondent attributes with `group_` prefix. All `camelCase` attribute keys are translated to `snake_case`. All *object attributes* will be flattened to attributes prefixed by object key. All *array attributes* will be omitted.

```text
analytics.group('group123', {
    name: 'Company Inc.',
    address: {
        street: '6th St',
        city: 'San Francisco',
        state: 'CA',
        postalCode: '94103',
        country: 'USA'
    },
    categories: ['startup','SaaS']
});
```

The above described call creates the following respondent's traits in Survicate:

| key                          | value         |
| ---------------------------- | ------------- |
| group\_id                    | group123      |
| group\_name                  | Company Inc.  |
| group\_address\_street       | 6th St        |
| group\_address\_city         | San Francisco |
| group\_address\_state        | CA            |
| group\_address\_postal\_code | 94103         |
| group\_address\_country      | USA           |

*Categories* attribute is omitted as it is an array attribute.

## Track

A Segment track call, f.ex:

```text
analytics.track('plan_purchased', {
    plan: 'Pro Annual',
    accountType : 'Facebook'
});
```

will trigger a Survicate call that sends the event name and properties to Survicate.

If you want to trigger your survey on a Segment event, you are able to do that by setting that condition in the panel in the targeting tab in the section: "When a user triggers an event" under "Where would you like to show the survey".

When the Segment event fires and other targeting conditions you've set in the panel are met - your survey will show.

Event properties are optional.

### Sending survey answers to Segment

Once the Segment integration is enabled in Survicate Integrations tab, it starts sending track events from your client-side source. Here's a sample call that will be triggered when a survey is answered.

```text
analytics.track('survicate_survey_answered', {
  answer: 'Great suppport!',
  answer_type: 'text',
  question: 'What makes us stand out from the competition?',
  survey: 'Advantages Over Competition Research',
});
```

## Settings

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

| Field         | Description                                   | Required | Type   |
| ------------- | --------------------------------------------- | -------- | ------ |
| Workspace Key | The workspace key for your Survicate account. | Yes      | string |
