> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rokt

> Empower your marketing team by delivering up-to-date event data to Rokt straight from your warehouse

Rokt is an ecommerce marketing platform for personalized offers and ads. Hightouch sends conversion events to Rokt for campaign optimization and attribution, and keeps Rokt audiences up to date for targeting and suppression.

## Supported syncing

| Sync Type | Description | Supported Sync Modes | API Reference |
| - | - | - | - |
| [**Event**](#event) | Send conversion events to Rokt for campaign optimization and attribution | Insert | [Send conversion events ↗](https://docs.rokt.com/developers/integration-guides/getting-started/advertisers/ads-events-api-integration/) |
| [**Segment**](#segment) | Create Rokt audiences and keep their membership up to date for targeting or suppression | Add, Remove | [Update audience membership ↗](https://docs.rokt.com/developers/integration-guides/getting-started/advertisers/ads-audience-api-integration/) |

For more information about sync modes, refer to the [sync modes](https://docs.hightouch.com/syncs/types-and-modes.md#sync-modes) docs.

## Connect to Rokt

Go to the [**Destinations** overview page](https://app.hightouch.com/destinations?from=docs) and click the **Add destination** button. Select **Rokt** and click **Continue**.

### Select an API version

Rokt has deprecated its legacy Event and Audience APIs. Select **Current** as the **API Version** for new connections; the legacy APIs no longer receive updates, and Rokt recommends migrating existing connections.

Rokt destinations created before the **API Version** setting existed remain on the legacy APIs. To migrate one, set its **API Version** to **Current** and enter the [current API credentials](#current-api-credentials). Hightouch keeps your legacy credentials saved, so you can switch back if needed.

### Current API credentials

The current Event and Audience APIs authenticate with a single server-to-server key pair:

* **Server to Server Key**
* **Server to Server Secret**

Request the key pair from your Rokt account manager. Rokt's current APIs run on mParticle infrastructure, so if you manage your Rokt integration through mParticle, you can instead copy the values from the Hightouch feed under **Setup > Inputs** in the [mParticle dashboard](https://app.mparticle.com/data-platform/setup/inputs/) — see the [mParticle docs](https://docs.hightouch.com/destinations/mparticle.md) for how to create the feed.

One key pair covers both the Event and Segment integrations. The key's region prefix (for example `us1-` or `us2-`) determines which Rokt data center Hightouch sends events to; a key with no prefix routes to US1.

### Legacy API credentials

The legacy APIs use separate credentials per integration. Enter only the credentials for the sync types you use.

For **Event** syncs:

* **App ID**
* **App Secret**
* **Account ID**: You can find this in the URL of your Rokt account. Go to your profile settings and the URL will look like this: `https://my.rokt.com/accounts/<accountId>/profile-settings`

You can find the App ID and App Secret at the bottom of your Rokt profile settings. If you haven't created an app yet, create an app and generate the two values. For more information, refer to [Rokt's docs](https://docs.rokt.com/developers/api-reference/event-api#generating-app-id-and-app-secret).

For **Segment** syncs, you also need to enter your **API Key**. You can retrieve one by following the instructions in [Rokt's docs](https://docs.rokt.com/developers/api-reference/custom-audience-import/#authorization).

## Sync configuration

Once you've set up your Rokt destination and have a [model](https://docs.hightouch.com/getting-started/concepts.md#models) to pull data from, you can set up your sync configuration to begin syncing data. Go to the [**Syncs** overview page](https://app.hightouch.com/syncs?from=docs) and click the **Add sync** button to begin. Then, select the relevant model and the Rokt destination you want to sync to.

### Event

When syncing events, Hightouch treats any records added to [your source](https://docs.hightouch.com/getting-started/concepts.md#sources) as new events and sends them to Rokt when your sync runs.

> [!WARNING]
>
> To ensure syncs send each event, your event model must use a truly unique [primary key](https://docs.hightouch.com/getting-started/concepts.md#unique-primary-key-requirement). See the [events syncs](https://docs.hightouch.com/syncs/types-and-modes.md#event-syncs) documentation for more information.

#### Event timestamp

You can optionally select a column that contains timestamps of when events occurred. If this field is empty, Hightouch uses the time the event arrives at the server.

If you select a column, it should be in UTC and RFC 3339. On the legacy API, Rokt rejects events with a timestamp older than 18 months or more than 5 minutes in the future; events outside this range aren't processed.

#### Field mapping

You can sync model columns to Rokt's event properties, including custom fields. You must include mappings for the **Client Event ID** and **Event Type** fields. Rokt deduplicates events on the **Client Event ID**, so map a value that's unique per event, such as an order or confirmation number.

On the current API, each event must also include at least one identifier: **Email**, **Email (SHA-256 Hash)**, or **Passback Conversion Tracking ID**. Rokt rejects events without one.

If you capture the Rokt click ID from your ad interactions, map it to **Passback Conversion Tracking ID**. Rokt uses it to match conversions back to clicks, and Hightouch sends it in both fields Rokt matches on.

#### Handling PII and hashing

By default, Hightouch automatically hashes plaintext values mapped to the **(SHA-256 Hash)** variants of the following fields before sending them to Rokt:

* **Email**
* **Mobile Phone**
* **First Name**
* **Last Name**
* **IP Address**

You can disable this behavior in the sync configuration. If disabled, the data from the model should be appropriately normalized and hashed according to [Rokt's hashing requirements](https://docs.rokt.com/developers/integration-guides/data-and-security/pii-data-hashing/).

### Segment

Use segment syncs to add users to a Rokt audience and remove them as they leave your model. You can use these audiences to target or exclude specific customers in your campaigns, or to determine which customers experience Rokt on your site.

#### User identifiers

The identifiers you can map depend on the destination's API version.

On the **current** API, select one or more of these model columns to identify users:

* **Email (SHA256 Hash)**
* **Customer ID**
* **IDFA (iOS advertising ID)**
* **GAID (Android advertising ID)**
* **Phone (SHA256 Hash)**
* **First name**
* **Last name**
* **City**
* **State**
* **Postal code**

Rokt matches the identifiers against its network and resolves them to a single user, so mapping more identifiers increases the share of your audience Rokt can reach. Rokt recommends including an email identifier.

At least one mapping must be a hashed email, customer ID, IDFA, or GAID. Phone, name, and address values enrich a match but can't anchor one, so Hightouch rejects rows without one of the anchor identifiers. Rokt can only match a customer ID it has already seen, for example from your Event syncs.

The current API doesn't support MD5-hashed emails. Use **Email (SHA256 Hash)** instead.

On the **legacy** API, map exactly one email identifier: **Email**, **Email (MD5 Hash)**, or **Email (SHA256 Hash)**.

> [!TIP]
>
> Increase match rates in Rokt audiences by enabling [Match Booster](https://docs.hightouch.com/match-booster/overview.md).

#### Phone number formatting

Rokt hashes phone numbers as the national number, without the country code. When you map **Phone (SHA256 Hash)**, Hightouch removes the country code before hashing. Select a **Default country** for numbers that arrive without one.

#### Select an existing audience or create a new one

You can create a new audience or use an existing one. When creating a new audience, you can optionally enter a name; otherwise, Hightouch defaults to the name of the associated model. To use an existing audience, select the desired audience from the dropdown.

Rokt creates the audience when the first record syncs to it. Audience names are limited to 100 characters.

#### Handling PII and hashing

By default, Hightouch automatically hashes unhashed emails — and, on the current API, phone numbers — before sending them to Rokt. You can disable this behavior in the sync configuration.

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

> [!NOTE]
>
> For Hightouch platform error codes related to Rokt, see [Error codes: Other
> destinations](https://docs.hightouch.com/developer-tools/error-codes.md#other-destinations).

### Validate your setup

To confirm events are arriving, check conversion reporting in Rokt or coordinate with your Rokt account manager. For audiences, confirm the audience appears in your Rokt account after the first sync completes.
