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

# Set up Exposure Log Matching

> Request a log feed from your ad platform, send setup details to Hightouch, and add the matched logs to your Customer Studio schema.

> [!NOTE]
>
> Exposure Log Matching is available to [Match Booster](https://docs.hightouch.com/match-booster/overview) customers and must be enabled by Hightouch. [Contact us](#pylon-chat) to turn it on.

Setting up Exposure Log Matching involves you, your ad platform, and Hightouch. You request a log feed from your ad platform and add the matched logs to your schema. Hightouch configures matching and starts delivery.

## Before you begin

Make sure you have:

* An account with a [supported ad platform](https://docs.hightouch.com/exposure-log-matching/overview#supported-platforms).
* A Snowflake, Databricks, Trino, or PostgreSQL source connected to Hightouch with the [Lightning sync engine](https://docs.hightouch.com/syncs/lightning-sync-engine.md) enabled.
* A model whose primary key is the ID you want to match logs to, such as a customer ID or household ID. In Customer Studio, this is typically your parent model.
* [Match Booster](https://docs.hightouch.com/match-booster/quick-start.md) set up on that model in the US region, with at least one Email, Email SHA256, Phone, Phone SHA256, or Mobile ID column mapped.
* A live campaign on your ad platform, so there are logs to receive.

Your platform's page lists any extra requirements.

## Setup steps

**1. Set up Match Booster on your model**

**Who:** data teams or platform admins

Hightouch matches logs using the identifiers mapped in your model's Match Booster configuration, then uses the Match Booster identity graph to match the rest. Map the identifiers you want to match on. See [Identifiers Hightouch uses](https://docs.hightouch.com/exposure-log-matching/overview#identifiers-hightouch-uses) for accepted formats, and [Configure Match Booster on a model](https://docs.hightouch.com/match-booster/configure-model.md) for how to map them.

If you haven't set up Match Booster on the model yet, follow [Get started with Match Booster](https://docs.hightouch.com/match-booster/quick-start.md) first. Your platform's page lists the Match Booster regions it supports.

**2. Request a log feed from your ad platform**

**Who:** you

1. Contact your ad platform representative and ask them to send your exposure logs to Hightouch. Most platforms require you to make this request yourself. Hightouch can't make it for you.
2. Provide the account IDs and feed choices listed on your platform's page:
   * [The Trade Desk](https://docs.hightouch.com/exposure-log-matching/platforms/the-trade-desk.md#request-the-feed)

**3. Your ad platform sets up the feed**

**Who:** your ad platform

Your ad platform representative sets up the feed and confirms when logs are reaching Hightouch. You don't need to do anything in this step.

**4. Send setup details to Hightouch**

**Who:** data teams or platform admins

Send Hightouch:

* Your ad platform and the account IDs from step 2.
* The model you want to match logs to.
* The date history should start from. By default, this is the day Exposure Log Matching is enabled. Hightouch doesn't backfill logs from before this date.

**5. Hightouch configures and tests matching**

**Who:** Hightouch

Hightouch configures matching and runs a one-day test. Hightouch reviews the results and match rates with you, then starts delivery to your warehouse.

Each delivery covers one finished UTC day and usually arrives the following UTC day. Each daily run queries your full model, so expect one large query on your warehouse each day.

**6. Add exposure logs to your schema**

**Who:** data teams

After the first delivery, add the matched logs to your Customer Studio schema so marketers can use them in audiences. The `ID` column in each view holds the SHA-256 hex digest of your model's primary key, not the key itself, so you join on a hashed column.

1. [Add a hashed primary key column](#add-a-hashed-primary-key-column) to your parent model.
2. Go to **Customer Studio > [Schema](https://app.hightouch.com/schema-v2/view?from=docs)**.
3. [Create an event model](https://docs.hightouch.com/customer-studio/schema.md#add-an-event-model) for each feed's view, such as impressions and clicks.
4. Relate each event model to your parent model with a one-to-many relationship.
5. In each relationship, join the hashed primary key column to the `ID` column.
6. Name each event model by platform and feed, such as "The Trade Desk impressions," so models for other platforms sit beside it.

If you don't use Customer Studio, query the matched logs directly in your warehouse. Join them to your customer table with the same hash expression. See [Exposure Log Matching output reference](https://docs.hightouch.com/exposure-log-matching/output-reference.md#sample-queries).

**7. Use the data**

**Who:** marketers or analysts

* Build audiences that filter on impressions, clicks, or campaign details. See [Audience filters](https://docs.hightouch.com/customer-studio/audience-filters.md).
* Ask an [agent](https://docs.hightouch.com/agents/overview) to report reach and frequency by customer segment.

## Add a hashed primary key column

To join the matched logs to your parent model, add the hash of its primary key as a computed column in the model's query. Your warehouse computes the hash each time Hightouch queries the model, so nothing is stored or hard-coded.

The hash must match the `ID` column exactly. To match it, the hash must:

* Use SHA-256.
* Hash the primary key cast to text.
* Return a lowercase hexadecimal string of 64 characters.

To add the column:

1. Open your parent model and click **Edit** on its query. If the query type is **Table selector**, change it to **SQL query** first.

2. Edit the query to add the hashed column. For example, in Snowflake:

   ```sql theme={null}
   SELECT
     *,
     LOWER(SHA2(CAST(user_id AS VARCHAR), 256)) AS pk_sha256
   FROM analytics.users
   ```

3. Save the query, then refresh the model's columns.

The hash expression differs by warehouse. Replace `<primary_key>` with your primary key column:

| Warehouse | Expression |
| - | - |
| Snowflake | `LOWER(SHA2(CAST(<primary_key> AS VARCHAR), 256))` |
| Databricks | `LOWER(SHA2(CAST(<primary_key> AS STRING), 256))` |
| Trino | `LOWER(TO_HEX(SHA256(TO_UTF8(CAST(<primary_key> AS VARCHAR)))))` |
| PostgreSQL | `ENCODE(SHA256(CAST(<primary_key> AS TEXT)::BYTEA), 'hex')` |

For example, the primary key `10482` produces `220c2ca81adf216ca1ef65bcc369ab19e7dc3e3b2610703e3b61054d358d1a6c`.

## Add another platform

Repeat steps 2 through 6 for each ad platform. Your existing event models don't change.

## Check your results

After each delivery, check the matched logs in your warehouse:

* **Tables and views** — Find them in the schema listed in [Where Hightouch writes logs](https://docs.hightouch.com/exposure-log-matching/output-reference.md#where-hightouch-writes-logs).
* **Match rate** — Count the share of rows with an `ID`. The output reference includes a [sample query](https://docs.hightouch.com/exposure-log-matching/output-reference.md#match-rate).
* **Columns** — See [Columns Hightouch adds](https://docs.hightouch.com/exposure-log-matching/output-reference.md#columns-hightouch-adds), and your platform's page for the platform's own columns.

## Next steps

* [Exposure Log Matching output reference](https://docs.hightouch.com/exposure-log-matching/output-reference.md) to learn which view to query and how each row was matched.
* [Audience filters](https://docs.hightouch.com/customer-studio/audience-filters.md) to build audiences from impressions and clicks.
