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

# StackAdapt

> Learn how to set up StackAdapt integration with Rockerbox for display, mobile and OTT tracking

## Setup Process

### Display and Mobile

1. Contact [support@rockerbox.com](mailto:support@rockerbox.com) to enable the integration. Let the team know the launch date and the [tier structure](https://help.rockerbox.com/article/obce43haen-1-hierarchy-mappings) you'd like applied
2. Append click-through URL parameters to your landing page URLs and apply the impression pixel to all active ads using the instructions below. Parameters use macros and do not need to be manually replaced
3. Set up automated spend reporting from StackAdapt to Rockerbox (see Batch Spend section below). This should be completed before launch
4. Allow at least one full day of data collection after launch, then let Rockerbox know you have launched so they can QA your URL and impression pixels

### OTT/CTV

1. Contact [support@rockerbox.com](mailto:support@rockerbox.com) to enable the integration. Let the team know the launch date and the [tier structure](https://help.rockerbox.com/article/obce43haen-1-hierarchy-mappings) you'd like applied
2. Rockerbox will provide an S3 endpoint for daily automated OTT log files and spend. StackAdapt must set up reporting to this endpoint. No other tracking is required for OTT

## Display

### URL Tracking Parameters

**Example Parameter String:**

```text wrap theme={null}
sa_campaignid={SA_CAMPAIGN_ID}&sa_lineitemid={SA_LINE_ITEM_ID}&sa_creativeid={SA_CREATIVE_ID}&sa_placementid={SA_PLACEMENT_ID}&sa_type=display
```

<Accordion title="Parameter Details">
  | Parameter        | Macro               | Description               |
  | ---------------- | ------------------- | ------------------------- |
  | `sa_campaignid`  | `{SA_CAMPAIGN_ID}`  | Campaign ID (required)    |
  | `sa_lineitemid`  | `{SA_LINE_ITEM_ID}` | Line Item ID              |
  | `sa_creativeid`  | `{SA_CREATIVE_ID}`  | Creative ID               |
  | `sa_placementid` | `{SA_PLACEMENT_ID}` | Placement ID              |
  | `sa_type`        | `display`           | Campaign Type (hardcoded) |
</Accordion>

### Impression Pixel

```text wrap theme={null}
https://metrics.getrockerbox.com/track/v5?source=[SOURCE]&tier_one=stackadapt-display&tier_two={SA_CAMPAIGN_ID}&tier_three={SA_LINE_ITEM_ID}&tier_four={SA_CREATIVE_ID}&tier_five={SA_PLACEMENT_ID}&auction_id={SA_REF_ID}&referrer={SA_REF_DOMAIN}
```

**Note:** `[SOURCE]` is a hardcoded value that must be obtained from Rockerbox. It's your company's [Account ID](https://app.rockerbox.com/v3/settings/account).

<Accordion title="Parameter Details">
  | Parameter    | Macro                | Description                     |
  | ------------ | -------------------- | ------------------------------- |
  | `tier_one`   | `stackadapt-display` | Platform identifier (hardcoded) |
  | `tier_two`   | `{SA_CAMPAIGN_ID}`   | Campaign ID (required)          |
  | `tier_three` | `{SA_LINE_ITEM_ID}`  | Line Item ID (required)         |
  | `tier_four`  | `{SA_CREATIVE_ID}`   | Creative ID (required)          |
  | `tier_five`  | `{SA_PLACEMENT_ID}`  | Placement ID                    |
  | `auction_id` | `{SA_REF_ID}`        | Reference ID (required)         |
  | `referrer`   | `{SA_REF_DOMAIN}`    | Referrer Domain                 |
</Accordion>

## Mobile App

Uses the same URL parameters as Display, with `sa_type=mobile`. The impression pixel adds a `mobile_device_id` field.

### URL Tracking Parameters

**Example Parameter String:**

```text wrap theme={null}
sa_campaignid={SA_CAMPAIGN_ID}&sa_lineitemid={SA_LINE_ITEM_ID}&sa_creativeid={SA_CREATIVE_ID}&sa_placementid={SA_PLACEMENT_ID}&sa_type=mobile
```

### Impression Pixel

```text wrap theme={null}
https://metrics.getrockerbox.com/track/v5?source=[SOURCE]&tier_one=stackadapt-mobile&tier_two={SA_CAMPAIGN_ID}&tier_three={SA_LINE_ITEM_ID}&tier_four={SA_CREATIVE_ID}&tier_five={SA_PLACEMENT_ID}&mobile_device_id={SA_DEVICE_ID}&auction_id={SA_REF_ID}&referrer={SA_REF_DOMAIN}
```

**Note:** `[SOURCE]` is a hardcoded value that must be obtained from Rockerbox. It's your company's [Account ID](https://app.rockerbox.com/v3/settings/account).

## OTT/CTV

OTT tracking is handled entirely through S3 log files. No URL parameters or impression pixels are required.

### URL Tracking Parameters

**Example Parameter String:**

```text wrap theme={null}
sa_campaignid={SA_CAMPAIGN_ID}&sa_lineitemid={SA_LINE_ITEM_ID}&sa_creativeid={SA_CREATIVE_ID}&sa_placementid={SA_PLACEMENT_ID}&sa_type=ott
```

### S3 Log File Delivery

StackAdapt sends daily log files to an S3 endpoint provided by Rockerbox. These files contain impression-level data for OTT campaigns.

## Batch Spend

### Display and Mobile

1. Contact [support@rockerbox.com](mailto:support@rockerbox.com) to obtain the endpoint details for StackAdapt batch file delivery
2. Share the endpoint details with StackAdapt and request daily automated reporting with the following requirements:
   * Files sent on a daily cadence
   * Each file contains the previous 1 day of spend data
   * No spaces in file names

**Required Columns** (must match exactly, including capitalization and spacing):

```
Campaign Group ID
Campaign
Date
Creative
Media Cost
Campaign ID
Campaign Group
Creative ID
```

### OTT/CTV

1. Contact [support@rockerbox.com](mailto:support@rockerbox.com) to obtain the S3 endpoint details for StackAdapt OTT log delivery
2. Share the endpoint details with StackAdapt and request daily automated reporting with the following requirements:
   * Files sent on a daily cadence
   * Each file contains the previous 1 day of data

**Required Columns** (must match exactly, including capitalization and spacing):

```
hashed_ip_sha256
device_type
ad_group_id
campaign_id
creative_id
cost
timestamp
ad_group_name
campaign_name
creative_name
```

**IP Address Requirements:**

* IP addresses must be in IPv4 format
* Rockerbox can only attribute client-side IP addresses (not server-side)
* Apply a SHA-256 hash to the IP address

## Verification

After setup:

1. Verify impression pixels are firing correctly (check by inventory type)
2. Validate click tracking parameters are populating
3. Check spend data appears in Rockerbox dashboard after at least one full day
4. Contact [support@rockerbox.com](mailto:support@rockerbox.com) for QA assistance
