# Setup & Prerequisites

Before creating In-Browser Message campaigns, confirm the following are in place. These are one-time configuration tasks shared across the Treasure AI platform team.

## Checklist

### Treasure AI platform (IT / Data Engineer)

1. **RT Personalization 2.0 is enabled** for your account. Contact your Customer Success Manager if unsure.
2. **HTTPS is required** — the target website must be served over HTTPS. RT Personalization 2.0 does not operate over HTTP.
3. **ID stitching** is configured so user identities are resolved across events (for example, `td_client_id` linked to your internal user ID).


### Audience Studio (Data Engineer / Marketer)

1. **A Parent Segment** exists with the relevant customer data and RT attributes.
2. **A Real-Time Personalization** and at least one **section** are created in Audience Studio using the relevant parent segment.


### Website (Developer)

1. **The TD Web SDK is installed and initialized** on the target website. See [SDK Integration](/products/marketing-cloud/engage-studio/experiences/sdk-integration) for the full implementation guide.
2. **Business events are flowing** into Treasure AI (`view_item`, `add_to_cart`, etc.). See [Event Tracking](/products/marketing-cloud/engage-studio/experiences/event-tracking) for event definitions and naming conventions.
3. **(Recommended) Server-Side Cookie (SSC) infrastructure is deployed** on your domain. SSC issues `td_ssc_id` from your own server, avoiding browser ITP restrictions that cap JavaScript-set cookies to 7 days on Safari/iOS. Requires a small server endpoint on your domain (e.g., `ssc.yourdomain.com`). Contact your Customer Success Manager for the SSC setup guide.


## How the SDK Renders Messages

When the RT Personalization API returns a campaign payload, the SDK renders the message automatically:

```mermaid
flowchart TD
    A[Personalization API returns payload] --> B{Message Type?}
    B -->|Popup| C[Inject popup container overlay\non top of page]
    B -->|Inline| D[Replace innerHTML of\nCSS selector–matched Zone]
    C --> E[Position per placement setting\nShow only latest created_at popup]
    D --> F[Render all returned\ninline messages]
```

| **Message Type**  | **SDK Rendering Behavior**  |
|  --- | --- |
| **Popup** | Injects a popup container overlay on top of the page. The popup is positioned according to the `placement` setting configured in the campaign. Only the popup with the latest `created_at` timestamp is displayed when multiple popups are returned. |
| **Inline** | Replaces the `innerHTML` of the DOM element matched by the campaign's CSS selector (Zone ID). All returned inline messages are rendered. If the selector does not match any element, the message is silently skipped. |


## Next Steps

SDK Integration
Install the TD Web SDK, initialize with personalization, and configure framework-specific page view tracking.

Event Tracking
Define business events using GA4-compatible naming for RT 2.0 targeting.