> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/activate/event-streaming/destinations/advertising/stackadapt.md).

# StackAdapt

**StackAdapt** is a programmatic advertising platform for native, display, video, and connected TV campaigns. This destination loads the StackAdapt Universal Pixel in the browser and forwards identify and track events for conversion measurement and audience targeting. There is no server-side component.

## Getting started

This is a browser destination. Chord loads the StackAdapt Universal Pixel for you, so you don't install any script.

You need your Universal Pixel ID, found on the **Pixels** page in your StackAdapt account.

## Settings

* **Destination Name** (required): a name to tell this destination apart.
* **Pixel ID** (required): your StackAdapt Universal Pixel ID, found under **Pixels > Universal Pixel** in your StackAdapt account.
* **Consent Requirements** (optional): the consent categories a visitor must accept before Chord sends data to this destination. See [Consent](/activate/event-streaming/consent.md).

## Connect

Add **StackAdapt Pixel** from the destination catalog, using the settings above. See [Connect a destination](/activate/event-streaming/connect-a-destination.md) for the full steps.

## Event mapping

| Chord event | StackAdapt event                       | Notes                                                                                                     |
| ----------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `page`      | `saq("ts", pixelId)`                   | Page view tracking call                                                                                   |
| `identify`  | *(stores user traits in memory)*       | Traits attached to subsequent track events; not sent immediately                                          |
| `track`     | `saq("conv", pixelId, conversionData)` | All track events forwarded as conversions, except an `Order Completed` with no products, which is skipped |

## Page events

Fires a StackAdapt page view tracking call.

**StackAdapt SDK call:** `saq("ts", pixelId)`

No additional attributes are sent with page events.

## Identify events

Identify events store user traits in browser memory. These traits are **not** sent to StackAdapt immediately — they are attached to all subsequent track conversion events for the duration of the browser session.

| Chord source (priority order)                                               | StackAdapt field | Notes |
| --------------------------------------------------------------------------- | ---------------- | ----- |
| `properties.email` > `context.traits.email` > `traits.email`                | `email`          |       |
| `properties.first_name` > `context.traits.first_name` > `traits.first_name` | `first_name`     |       |
| `properties.last_name` > `context.traits.last_name` > `traits.last_name`    | `last_name`      |       |
| `properties.phone` > `context.traits.phone` > `traits.phone`                | `phone`          |       |

## Track events

Sends a conversion event to StackAdapt with ecommerce data and any previously stored user traits from `identify` calls.

**StackAdapt SDK call:** `saq("conv", pixelId, conversionData)`

### Always included

| Chord source (priority order)  | StackAdapt field | Notes                                   |
| ------------------------------ | ---------------- | --------------------------------------- |
| `event` (the track event name) | `action`         |                                         |
| Stored from `identify`         | `email`          | Included if an `identify` call was made |
| Stored from `identify`         | `first_name`     | Included if an `identify` call was made |
| Stored from `identify`         | `last_name`      | Included if an `identify` call was made |
| Stored from `identify`         | `phone`          | Included if an `identify` call was made |

### Order-level attributes

| Chord source (priority order)                                                                               | StackAdapt field | Notes                                                                      |
| ----------------------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------------------------------------------- |
| `properties.cart_id` > `properties.cartId` > `properties.order_id` > `properties.orderId` > `properties.id` | `order_id`       | Included if present. A cart ID wins over an order ID when both are present |
| `properties.revenue` > `properties.total` > `properties.value` > calculated from products                   | `revenue`        | Prefers subtotal (excluding tax/shipping)                                  |
| `properties.currency` > `properties.meta.i18n.currency`                                                     | `currency`       | Defaults to `"USD"`                                                        |

### Product attributes (single product)

When a single product is present (root-level `properties` for single-product events like Product Added and Product Viewed, or a single-element `properties.products[]`), product fields are sent as flat attributes. Root-level `properties` take priority over `properties.products[0]` when both are present.

| Chord source (priority order)                                                                                                                                   | StackAdapt field   | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- |
| `properties.product_id` > `properties.id` > `properties.sku` > `properties.products[0].product_id` > `properties.products[0].id` > `properties.products[0].sku` | `product_id`       |       |
| `properties.category` > `properties.products[0].category`                                                                                                       | `product_category` |       |
| `properties.name` > `properties.products[0].name`                                                                                                               | `product_name`     |       |
| `properties.price` > `properties.products[0].price`                                                                                                             | `product_price`    |       |
| `properties.quantity` > `properties.products[0].quantity` — defaults to `1`                                                                                     | `product_quantity` |       |

### Product attributes (multiple products)

When `properties.products[]` contains two or more products, they are sent as a `products` array. Each element uses the same field mapping as the single product above. Empty product objects are filtered out.

## Initialization

Chord loads the StackAdapt Universal Pixel script and manages SDK loading state (`fresh` → `loading` → `loaded`/`failed`) to prevent duplicate script loads. If the script fails to load, subsequent events are silently dropped.

## CSP requirements

If your site uses a Content Security Policy, allow the following domains:

| Directive     | Domain                                                    |
| ------------- | --------------------------------------------------------- |
| `script-src`  | `https://tags.srv.stackadapt.com`                         |
| `connect-src` | `https://tags.srv.stackadapt.com`, `https://qvdt3feo.com` |
| `style-src`   | `https://tags.srv.stackadapt.com`                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/activate/event-streaming/destinations/advertising/stackadapt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
