# Cookie Sync

## Overview

Cookie syncing allows Nexx360 to share user identifiers with demand partners, improving match rates and bid performance. There are two approaches: passing IDs directly in the bid request, or using Nexx360's cookie sync endpoints.

## ID Sharing via Bid Request

When a seller is already synced with third-party partners, they can share user IDs through the `user.ext.eids` field in the OpenRTB request.

### EID Format

```json
{
    "source": "adnxs.com",
    "uids": [
        {
            "id": "6193521930111213563"
        }
    ]
}
```

## Cookie Sync Endpoints

Nexx360 provides two cookie sync endpoints that DSPs can use to sync user IDs with Nexx360.

### Redirect Endpoint

```
GET https://fast.nexx360.io/usermatchredir/redirect
```

This endpoint reads the Nexx360 user cookie (`xxuid`), and if a redirect URL is provided, replaces the `$UID` macro with the user ID and redirects the user to that URL.

#### Query Parameters

| Parameter      | Required | Description                                |
| -------------- | -------- | ------------------------------------------ |
| `gdpr`         | No       | GDPR applies flag (`0` or `1`)             |
| `gdpr_consent` | No       | TCF consent string                         |
| `us_privacy`   | No       | US Privacy (CCPA) string                   |
| `gpp`          | No       | Global Privacy Platform string             |
| `gppsid`       | No       | GPP Section ID                             |
| `redir`        | No       | URL-encoded redirect URL with `$UID` macro |

#### Example

```
https://fast.nexx360.io/usermatchredir/redirect?gdpr=0&redir=https%3A%2F%2Fdsp.com%2Fsync%3Fuid%3D%24UID
```

This will redirect the user to `https://dsp.com/sync?uid=<xxuid>` where `<xxuid>` is the Nexx360 user ID.

#### Behavior

* If GDPR consent is required but not valid, returns `200` with no sync.
* If no `xxuid` cookie is present, returns `204`.
* If no `redir` parameter is provided, the cookie is refreshed and returns `204`.
* If a valid `redir` is provided, replaces `$UID` with the user ID and responds with a `302` redirect.
* Only the `$UID` macro is supported. Other macros will return a `400` error.

### Iframe Endpoint

```
GET https://fast.nexx360.io/usermatchredir/iframe
```

This endpoint returns an HTML page that can be loaded in an iframe. The page embeds the Nexx360 user ID and privacy parameters, then executes a cookie sync script that handles syncing with multiple demand partners.

#### Query Parameters

| Parameter      | Required | Description                    |
| -------------- | -------- | ------------------------------ |
| `gdpr`         | No       | GDPR applies flag (`0` or `1`) |
| `gdpr_consent` | No       | TCF consent string             |
| `us_privacy`   | No       | US Privacy (CCPA) string       |
| `gpp`          | No       | Global Privacy Platform string |
| `gppsid`       | No       | GPP Section ID                 |
| `redir`        | No       | URL-encoded redirect URL       |

#### Example

```html
<iframe src="https://fast.nexx360.io/usermatchredir/iframe?gdpr=0" style="display:none"></iframe>
```

#### Behavior

* Returns an HTML page with a `window.cookieSyncRedir` object containing the privacy config and `xxuid`.
* If GDPR consent is required but not valid, the page is returned without the `xxuid`.
* The embedded script handles syncing with demand partners automatically.

## Supported Sync Partners

| Partner                 | Cookie Domain      |
| ----------------------- | ------------------ |
| AdaptMX                 | a-mo.net           |
| Adform                  | adform.net         |
| Adot                    | adotmob.com        |
| Adyoulike               | omnitagjs.com      |
| Appnexus (Xandr)        | adnxs.com          |
| Bidswitch               | bidswitch.net      |
| Bliink                  | bliink.io          |
| Colossus                | colossusssp.com    |
| ConnectAd               | connectad.io       |
| Conversant              | dotomi.com         |
| e-Planning              | e-planning.net     |
| Freewheel               | stickyadstv.com    |
| GumGum                  | gumgum.com         |
| Improve (Azerion)       | 360yield.com       |
| Index Exchange          | casalemedia.com    |
| Media.net               | media.net          |
| NextMillennium          | nextmillmedia.com  |
| OneTag                  | onetag-sys.com     |
| OpenX                   | openx.net          |
| Outbrain                | zemanta.com        |
| Pubmatic                | pubmatic.com       |
| PulsePoint              | contextweb.com     |
| RichAudience            | richaudience.com   |
| Rise                    | yellowblue.io      |
| RTB House               | creativecdn.com    |
| Rubicon (Magnite)       | rubiconproject.com |
| Sharethrough            | sharethrough.com   |
| Smaato                  | smaato.net         |
| Smartadserver (Equativ) | smartadserver.com  |
| Smilewanted             | smilewanted.com    |
| Triplelift              | 3lift.com          |
| The Trade Desk          | adsrvr.org         |
| Yieldlab                | yieldlab.net       |
