# Wisepops Destination

[Wisepops](https://wisepops.com/) offers an end-to-end platform to help all types of online brands deliver a personalized experience to their visitors through multiple formats: popups, bars, embeds and notifications feed.
Wisepops powers 2,000 brands in 53 countries and delivers 2 billion personalized onsite messages each year to convert visitors into loyal customers.

When you use the Wisepops destination, Segment loads Wisepops on your website for you. With no development, you can target your users based on their traits or events, display personalized messages, and track the revenue generated by your campaigns.

## Getting started

1. From the Segment web app, click **Catalog**, then click **Destinations**.
2. Find the Wisepops item in the catalog, and click it.
3. Click **Configure Wisepops**.
4. Select an existing Source to connect to Wisepops.
5. Give the destination a name.
6. In the **Basic Settings** page, enter your **Website Identifier**. It can be found in your [Wisepops setup code](https://id.wisepops.com/r/id/workspaces/_workspaceId_/settings/setup-code). It's the bolded string that's 10 characters long.

   ![HTML script snippet for Wisepops setup with highlighted hash parameter.](https://docs-resources.prod.twilio.com/ddef0ede4c6f99263a0452989e727b14577b90c9c3e22c8c331b4d23e8d9dd0b.png)
7. Toggle **Enable Destination** and click **Save Changes**.

> \[!NOTE]
>
> This destination is compatible only with [Analytics.js 2.0](/docs/segment/connections/sources/catalog/libraries/website/javascript/). Server-side `identify` and `track` calls don't trigger Wisepops' actions.

## Default Mapping

The Wisepops destination comes with mapping presets. You can adjust each default mapping by going to the **Mapping** tab of the destination in the Segment web app.

### Set User Traits as Custom Properties

By default, when you identify a user, their traits are set as [custom properties](https://support.wisepops.com/article/yrdyv1tfih-set-up-custom-properties).
A great use case is to [display the user first name in your campaign](https://support.wisepops.com/article/snksb93jrq-personalize-the-content-of-your-popup-on-the-fly):

![Template greeting with user first name and default 'there' option.](https://docs-resources.prod.twilio.com/b478c96a50bbd387fb36331797aa557c8f91c96aa0fef33dd1daffee8bf4ae7e.png)

> \[!TIP]
>
> The user ID is set as the custom property `userId`. For example, use `{{userId}}` as a hidden field value to know who responds to your Wisepops surveys.

### Set Group Traits as Custom Properties

By default, when you identify a group, its traits are set as [custom properties](https://support.wisepops.com/article/yrdyv1tfih-set-up-custom-properties) in a nested object `group`.
You must use the prefix `group.` when you refer to a group trait in Wisepops.
For example, you can [target the users of groups subscribed to your "Premium" plan](https://support.wisepops.com/article/yrdyv1tfih-set-up-custom-properties#defining-custom-conditions):

![Custom property rule for 'group.plan' with value 'Premium'.](https://docs-resources.prod.twilio.com/9b5b8c8a152fd3453cc1d72020d3cd1cf693e1b29497a95f91c09efc244727d6.png)

> \[!TIP]
>
> The group ID is set as the custom property `group.groupId`.

### Track Event

By default, when you track an event, Segment sends a [custom event](https://support.wisepops.com/article/zbpq1z0exk-set-up-custom-events-to-trigger-popups) to Wisepops.
To show a campaign when a custom event is emitted, enter the event name as the campaign trigger.
For example, you can display a popup when a product is added to the cart:

![Trigger options for campaign including On Custom Event with Set up for 'Product Added'.](https://docs-resources.prod.twilio.com/129f6e97706884cd354ea77da4628a10d70e9d0c0f4bcedf9133498492843fe5.png)

> \[!NOTE]
>
> If you track a lot of events with Segment, you may want to edit this mapping to send only the relevant events to Wisepops.

### Track Goal

The Track Goal action is not mapped by default. You can enable it to track [goal completion and revenue](https://support.wisepops.com/article/mx3z8na6yb-set-up-goal-tracking) on Wisepops.

To track a JavaScript goal using Segment:

1. [Create your JavaScript goal in Wisepops](https://id.wisepops.com/r/id/workspaces/_workspaceId_/goals).
2. Copy the goal identifier. It is a 32-character string visible after the goal is created:

   ![JavaScript snippet with Wisepops goal ID highlighted.](https://docs-resources.prod.twilio.com/99c723a4bb165e426973ec794a136224bf1d6f1ce42646f32592383480a56b51.png)
3. In Segment, create a new mapping with the action **Track Goal**.
4. In the first section, configure when the goal should be tracked.
5. In the third section, paste the goal identifier, without quotes, into the **Goal Identifier** field.
6. Save the new mapping.

### Track Page

By default, when you track a page, Segment sends a [page view](https://support.wisepops.com/article/uymb5lywhi-wisepops-on-single-page-applications) to Wisepops.
This mapping is required for Wisepops to display campaigns at page change.

## Destination Settings

| Field              | Description                                                                                                                                                                | Required | Type   |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Website Identifier | The identifier of your Wisepops' website. You can find it in \[your setup code on Wisepops]\(https://id.wisepops.com/r/id/workspaces/\_workspaceId\_/settings/setup-code). | Yes      | string |

## Available Presets

Wisepops has the following presets

| Preset Name                           | Trigger                 | Default Action        |
| ------------------------------------- | ----------------------- | --------------------- |
| Track Event                           | Event type = "track"    | Track Event           |
| Set User Traits as Custom Properties  | Event type = "identify" | Set Custom Properties |
| Set Group Traits as Custom Properties | Event type = "group"    | Set Custom Properties |
| Track Page                            | Event type = "page"     | Track Page            |

## Available Actions

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

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

* [Track Page](#track-page)
* [Set Custom Properties](#set-custom-properties)
* [Track Event](#track-event-21)
* [Track Goal](#track-goal)

### Track Page

Let Wisepops know when the visitor goes to a new page. This allows Wisepops to display campaigns at page change.

Track Page is a **Web** action. The default Trigger is `type = "page"`

This action does not have any fields.

### Set Custom Properties

Define [custom properties](https://support.wisepops.com/article/yrdyv1tfih-set-up-custom-properties) to let Wisepops target them in your scenarios.

Set Custom Properties is a **Web** action. The default Trigger is `type = "identify"`

| Field                           | Description                                                                                                                                                               | Required | Type   |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Custom Properties               | The custom properties to send to Wisepops.                                                                                                                                | Yes      | OBJECT |
| Entity ID                       | A unique identifier. Typically, a user ID or group ID.                                                                                                                    | No       | STRING |
| Property name for the entity ID | How to name the entity ID among the other custom properties?                                                                                                              | No       | STRING |
| Prefix                          | This lets you define the properties as a nested object. If you set the property \`"name"\` with the prefix \`"group"\`, you'll access it in Wisepops as \`"group.name"\`. | No       | STRING |

### Track Event

Send a [custom event](https://support.wisepops.com/article/zbpq1z0exk-set-up-custom-events-to-trigger-popups) to Wisepops. Keep in mind that events are counted as page views in your Wisepops' monthly quota.

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

| Field      | Description                                | Required | Type   |
| ---------- | ------------------------------------------ | -------- | ------ |
| Event Name | The name of the event to send to Wisepops. | Yes      | STRING |

### Track Goal

[Track goals and revenue](https://support.wisepops.com/article/mx3z8na6yb-set-up-goal-tracking) to know which campaigns are generating the most value.

Track Goal is a **Web** action. The default Trigger is `type = "track" and event = "Order Completed"`

| Field           | Description                                                                         | Required | Type   |
| --------------- | ----------------------------------------------------------------------------------- | -------- | ------ |
| Goal Identifier | This is a 32-character identifier, visible when you create the JS goal in Wisepops. | No       | STRING |
| Goal Revenue    | The revenue associated with the goal.                                               | No       | STRING |
