# Rokt Conversions API (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 **Rokt Conversions API** 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.**

[Rokt](https://www.rokt.com/?utm_source=segmentio\&utm_medium=docs\&utm_campaign=partners) is a global advertising technology platform that uses machine learning to unlock additional revenue for merchants by serving hyper-personalized offers to customers during the checkout process. The Rokt Conversions API (Actions) destination is a server-to-server integration that allows advertisers to send web, app, and offline conversion events from Segment directly to Rokt. This direct integration supports better attribution, audience targeting, and campaign optimization.

This destination is maintained by Rokt. For any issues with the destination, contact [Rokt Support](https://www.rokt.com/contact-us).

## Benefits of Rokt Conversions API (Actions)

The Rokt Conversions API (Actions) destination provides the following benefits:

* **Clear mapping of data**: Actions-based destinations let you define the mapping between the data Segment receives from your source and the data Segment sends to Rokt.
* **Privacy-focused**: Automatic SHA-256 PII hashing with flexible controls over what data is hashed supports compliance with privacy requirements.
* **Maximum event measurement**: Capture more events with improved accuracy across different browsers, apps, and devices to get a unified view of your customer journey.
* **Audience sync support**: Seamlessly sync [Twilio Engage audiences](/docs/segment/engage) to Rokt for advanced targeting and suppression.
* **Browser plugin integration**: Automatically capture Rokt transaction IDs (RTID) from web sources when combined with the Rokt Browser Plugin.

## Getting started

### Prerequisites

Before connecting to the Rokt Conversions API destination, you must have an account with Rokt and obtain your Conversions API (CAPI) credentials.

[Contact your Rokt representative](https://www.rokt.com/contact-us) to obtain:

* **API Key**: Your Rokt CAPI API Key
* **API Secret**: Your Rokt CAPI API Secret

### Add the destination

1. From your workspace's [Destination catalog page](https://app.segment.com/goto-my-workspace/destinations/catalog), search for "Rokt Conversions API".
2. Select **Rokt Conversions API (Actions)** and click **Add Destination**.
3. Select an existing Source to connect to Rokt Conversions API (Actions).
4. Enter your **API Key** and **API Secret** provided by your Rokt representative.
5. Click **Save Changes**.
6. On the **Mappings** tab, review and customize the default mappings for your use case.
7. Enable the destination by toggling the **Enabled** switch on the **Settings** tab.

## Destination Settings

| Field      | Description                                                                       | Required | Type     |
| ---------- | --------------------------------------------------------------------------------- | -------- | -------- |
| API Key    | Your Rokt CAPI API Key. Contact your Rokt representative to obtain this value.    | Yes      | password |
| API Secret | Your Rokt CAPI API Secret. Contact your Rokt representative to obtain this value. | Yes      | password |

## Available Presets

Rokt Conversions API has the following presets

| Preset Name          | Trigger                                                                                                            | Default Action      |
| -------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------- |
| Rokt Browser Plugin  | Event type = "track", Event  type = "identify", Event  type = "page", Event  type = "group", Event  type = "alias" | Rokt Browser Plugin |
| Sync Engage Audience | Event type = "identify"                                                                                            | Send                |
| Send                 | Event event = "Order Completed"                                                                                    | Send                |

## Available Actions

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

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

* [Rokt Browser Plugin](#rokt-browser-plugin)
* [Send](#send-2)

### Rokt Browser Plugin

Enriches all Segment payloads with Rokt rtid Querystring value

Rokt 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.

### Send

Send analytics data to Rokt CAPI.

Send is a **Cloud** action.

| Field                        | Description                                                                                                                                                              | Required | Type   |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ------ |
| Event Details                | Details about the event to be sent to Rokt CAPI.                                                                                                                         | Yes      | OBJECT |
| Additional Custom Attributes | Additional custom attributes for the event.                                                                                                                              | No       | OBJECT |
| Hashing Configuration        | Specify if email and certain user attributes should be hashed before sending.                                                                                            | No       | OBJECT |
| Device Information           | Information about the user device.                                                                                                                                       | No       | OBJECT |
| User Identities              | Unique user identifiers used to identify the user. At least one identifier is required, or the advertising ID in device info.                                            | No       | OBJECT |
| User Attributes              | Attributes related to the user.                                                                                                                                          | No       | OBJECT |
| IP Address                   | IP address of the user.                                                                                                                                                  | No       | STRING |
| Audience Details             | Details of the audience to add the user to or remove the user from. If connecting to a Segment Engage Audience, leave this field empty.                                  | No       | OBJECT |
| RTID                         | ROKT RTID value from the page URL. The 'Rokt Browser Plugin' Action automatically captures this value from the querystring in the browser, then passes it to this field. | No       | STRING |

## Browser plugin integration

When you connect an [Analytics.js source](/docs/segment/connections/sources/catalog/libraries/website/javascript) to the Rokt Conversions API destination, Segment automatically includes the Rokt Browser Plugin. This plugin:

* Extracts the Rokt transaction ID (RTID) from URL query parameters when visitors arrive on your site
* Stores the RTID in browser storage for use across the session
* Automatically includes the RTID with all events sent to the Rokt Conversions API

This seamless integration ensures proper attribution when users interact with Rokt placements and complete conversions on your site.

## Syncing Engage audiences

The Rokt Conversions API destination supports syncing Engage audiences to Rokt for advanced targeting and suppression use cases.

### Using Engage Audience Sync

1. Connect an Engage Space as your source when setting up the destination.
2. Enable the **Sync Engage Audience** preset mapping.
3. Navigate to **Engage > Audiences** and select the audience you want to sync.
4. Click **Add Destinations** and select your Rokt Conversions API destination.
5. Select **Default setup > Save > Add 1 destination**.

After enabling the Sync Engage Audience preset mapping, Segment adds or removes users from Rokt audiences based on their Engage audience membership.

### Using regular analytics events

You can also manage audience membership using standard Analytics events from any Segment source:

1. Send Track or Identify events with the following properties:
   * `audience_name`: The name of the audience
   * `audience_membership`: Boolean indicating whether to add (`true`) or remove (`false`) the user from the audience
2. The destination automatically processes these events and updates audience membership in Rokt.

## PII hashing

The Rokt Conversions API destination supports automatic SHA-256 hashing of personally identifiable information (PII) before sending data to Rokt. You can configure hashing for the following fields:

* Email address
* First name
* Last name
* Mobile number
* Billing zip code

By default, hashing is disabled for all fields. To enable hashing:

1. Navigate to the **Mappings** tab in your destination settings.
2. Select the mapping you want to configure.
3. Expand the **Hashing Configuration** section.
4. Toggle on hashing for the fields you want to hash.
5. Click **Save**.

Segment detects pre-hashed values and does not double hash them.

## Required user identifiers

To successfully send events to Rokt, you must include at least one of the following user identifiers:

* Email address
* Customer ID (User ID)
* Mobile advertising ID (IDFA for iOS, AAID for Android)
* IP address and User Agent

When possible, include multiple identifiers to improve matching and attribution accuracy.

## 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 Rokt Conversions API (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.
