# Dub (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 **Dub (Actions)** 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.
* This destination is **Beta.**

[Dub](https://dub.co/?utm_source=segmentio\&utm_medium=docs\&utm_campaign=partners) is the all-in-one link attribution platform for businesses to understand how their marketing spend is converting to sales.

This destination is maintained by Dub. For any issues with the destination, [contact the Dub Support team](mailto:support@dub.co).

## Getting started

1. From your Segment workspace's [Destination catalog page](https://app.segment.com/goto-my-workspace/destinations/catalog) search for "Dub (Actions)".
2. Select Dub (Actions) and click **Add Destination**.
3. Select an existing Source to connect to Dub (Actions).
4. Open your [Dub workspace](https://app.dub.co).
5. Go to Settings > [API Keys](https://app.dub.co/settings/tokens) in your workspace and create a new API key.
6. Return to your Segment workspace and enter the **API Key** in the Dub (Actions) destination settings page.

## Destination Settings

| Field   | Description                                                                    | Required | Type     |
| ------- | ------------------------------------------------------------------------------ | -------- | -------- |
| API Key | The API Key is available via Dub Dashboard: https://app.dub.co/settings/tokens | Yes      | password |

## Available Presets

Dub (Actions) has the following presets

| Preset Name        | Trigger                                                                                                            | Default Action     |
| ------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------ |
| Dub Browser Plugin | Event type = "track", Event  type = "identify", Event  type = "group", Event  type = "page", Event  type = "alias" | Dub Browser Plugin |

## Available Actions

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

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

* [Track a Lead](#track-a-lead)
* [Track a Sale](#track-a-sale)
* [Dub Browser Plugin](#dub-browser-plugin)

### Track a Lead

Track a Lead for a Short Link.

Track a Lead is a **Cloud** action. The default Trigger is `type = "track" and event = "Sign Up"`

| Field           | Description                                                                                   | Required | Type   |
| --------------- | --------------------------------------------------------------------------------------------- | -------- | ------ |
| Click ID        | The ID of the click in Dub. You can read this value from "dub\_id" cookie.                    | Yes      | STRING |
| Event Name      | The name of the Lead event to track.                                                          | Yes      | STRING |
| External ID     | The unique identifier for the customer in the your app. Used to track the customer's journey. | Yes      | STRING |
| Event Quantity  | The quantity of the Lead event to track.                                                      | No       | NUMBER |
| Customer Name   | The name of the customer.                                                                     | No       | STRING |
| Customer Email  | The email of the customer.                                                                    | No       | STRING |
| Customer Avatar | The avatar of the customer.                                                                   | No       | STRING |
| Metadata        | Additional metadata to be stored with the Lead event.                                         | No       | OBJECT |

### Track a Sale

Track a Sale for a Short Link

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

| Field             | Description                                                                                                                                                                                                         | Required | Type   |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| External ID       | This is the unique identifier for the customer in the your app. This is used to track the customer's journey.                                                                                                       | Yes      | STRING |
| Amount            | The amount of the Sale.                                                                                                                                                                                             | Yes      | NUMBER |
| Payment Processor | The payment processor via which the Sale was made.                                                                                                                                                                  | Yes      | STRING |
| Event Name        | The name of the Sale event. It can be used to track different types of event for example "Purchase", "Upgrade", "Payment", etc.                                                                                     | No       | STRING |
| Lead Event Name   | The name of the Lead event that occurred before the Sale (case-sensitive). This is used to associate the Sale event with a particular Lead event (instead of the latest Lead event, which is the default behavior). | No       | STRING |
| Invoice ID        | The invoice ID of the Sale. Can be used as a idempotency key – only one Sale event can be recorded for a given invoice ID.                                                                                          | No       | STRING |
| Currency          | The currency of the Sale. Accepts ISO 4217 currency codes.                                                                                                                                                          | No       | STRING |
| Metadata          | Additional metadata to be stored with the Sale event.                                                                                                                                                               | No       | OBJECT |

### Dub Browser Plugin

Enriches all Segment payloads with dub\_id cookie value

Dub Browser Plugin is a **Web** action. The default Trigger is `type = "track" or type = "identify" or type = "page" or type = "group" or type = "alias"`

This action does not have any fields.

For more information about developing with Dub, check out Dub's [Integrations documentation](https://dub.co/docs/integrations).

## 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 Dub (Actions)  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 | The API Key is available via Dub Dashboard: https://app.dub.co/settings/tokens | Yes      | password |
