# fbp/fbc Handling & Deduplication

### Overview

When installing the **META connector**, META recommends a **deduplicated setup** that runs **both client‑side and server‑side** tags. This introduces a configuration challenge: you must keep the **`fbp`** (Browser ID) and **`fbc`** (Click ID) values **consistent** across client and server executions for reliable attribution and event deduplication.

JENTIS simplifies this by automatically extracting META’s client‑side identifiers and **persisting them as first‑party, server‑set cookies** on your **JENTIS first‑party subdomain**. This design minimizes loss due to browser tracking prevention and ensures **stable deduplication** between browser and server events.

### Why this matters

* **Tracking prevention**: `fbp`/`fbc` created by META JS are **regular JavaScript cookies** and are therefore impacted by ITP/ETP and similar browser restrictions.
* **Consistency for deduplication**: Using the **same identifiers** for both client and server paths is required so META can **deduplicate** events correctly.
* **Longevity**: Moving identifiers into **first‑party, server‑set** cookies extends their **survivability** under modern browser policies.

### How JENTIS handles `fbp` / `fbc`

1. **META JS creates browser cookies** `fbp` and `fbc` on your website (per META’s standard behavior).
2. **JENTIS extracts** these values on the client.
3. JENTIS **re‑writes** and **persists** them as **first‑party, server‑side cookies** via your JENTIS first‑party subdomain:
   * `jts-fbp` (First‑party persisted Browser ID)
   * `jts-fbc` (First‑party persisted Click ID)
4. The server‑side META connector reads the same values to **keep browser and server events aligned**.

> **Note**\
> Creation of `fbp` and `fbc` by META JS is **not controlled by JENTIS**. JENTIS only **extracts and upgrades** them into durable, first‑party cookies (`jts-fbp`, `jts-fbc`).

### Default behavior at a glance

| Source                                 | Reads                | Writes               | Purpose                                                            |
| -------------------------------------- | -------------------- | -------------------- | ------------------------------------------------------------------ |
| META JS (client)                       | –                    | `fbp`, `fbc`         | Default META identifier creation (impacted by tracking prevention) |
| JENTIS (client)                        | `fbp`, `fbc`         | –                    | Extract values set by META JS                                      |
| JENTIS (server, first‑party subdomain) | –                    | `jts-fbp`, `jts-fbc` | Durable first‑party persistence to overcome tracking prevention    |
| META Connector (server)                | `jts-fbp`, `jts-fbc` | –                    | Consistent IDs for deduplication with browser events               |

### Recommended installation (deduplicated)

Use **both** client‑side and server‑side execution for META.

* **Client‑side**: META JS runs and sets `fbp`/`fbc`.
* **Server‑side**: JENTIS persists identifiers as `jts-fbp`/`jts-fbc` and uses them in server events.
* **Outcome**: Browser and server share the same IDs → **correct deduplication** and **higher stability** under tracking prevention.

> **Tip**\
> Ensure your **JENTIS first‑party subdomain** is properly configured. This is required for setting `jts-fbp`/`jts-fbc` cookies from the server.

### Server‑side–only setups

If you run **META only server‑side**, configure variables that replace the role of the browser cookies.

#### JENTIS variables involved

* **Browser‑ID (Facebook)**\
  Maintains a persistent **Browser ID** in the JENTIS storage and exposes it for server‑side META events. Typically mapped to `jts-fbp`.
* **Click‑ID (Facebook)**\
  Captures `fbclid` from the **URL parameter** and persists it in JENTIS storage. Typically mapped to `jts-fbc`.

#### What to configure

1. **Persist a Browser ID** even without META JS:
   * Use **Browser‑ID (Facebook)** to **generate or retrieve** a stable identifier and **store** it in JENTIS storage (first‑party).
   * Expose it as the value for `fbp` (server‑side).
2. **Capture and persist Click ID**:
   * Use **Click‑ID (Facebook)** to **read** the `fbclid` query parameter when present.
   * **Store** it in JENTIS storage for reuse across subsequent hits.
   * Expose it as the value for `fbc` (server‑side).

> **Important**\
> In server‑side–only mode, **do not rely on client cookies**. Your JENTIS variables must **source, persist, and expose** both IDs fully on the server path.

### Configuration steps (checklist)

1. **First‑party subdomain active**\
   Verify your JENTIS first‑party subdomain is live and can set cookies (required for `jts-fbp`, `jts-fbc`).
2. **Enable META connector**\
   Configure the META connector in JENTIS and map parameters for **`fbp`** and **`fbc`** to the JENTIS variables below.
3. **Map variables**
   * `fbp` ⇢ **Browser‑ID (Facebook)** (reads from `jts-fbp` or generates/loads from storage)
   * `fbc` ⇢ **Click‑ID (Facebook)** (parses `fbclid` and persists to `jts-fbc`/storage)
4. **Client + Server (recommended)**\
   Keep META JS active on the site; let JENTIS upgrade to first‑party cookies for resilience.
5. **Server‑only (optional)**\
   If no client META JS is present, ensure both variables are configured to **create/persist** IDs without browser cookies.

### Event deduplication notes

* META deduplication relies on **matching identifiers** sent from the browser and server.
* With JENTIS, `jts-fbp` and `jts-fbc` ensure the **same values** are available on both paths.
* For best results, **always send both `fbp` and `fbc`** when available.

### Troubleshooting

* **`fbp`/`fbc` missing in server calls**\
  Check variable mappings in the META connector. Ensure **Browser‑ID (Facebook)** and **Click‑ID (Facebook)** are enabled and resolving values.
* **Values reset or frequently changing**\
  Confirm that cookies are set from the **JENTIS first‑party subdomain** and not blocked by domain/path/consent scope.
* **No `fbclid` captured**\
  Verify campaign links include the **`fbclid`** parameter and that the **Click‑ID (Facebook)** variable is configured to parse and persist it.

### References

* META documentation: **`fbp` and `fbc` parameters**\
  <https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc/>

### FAQs

**Do I need both `fbp` and `fbc`?**\
Use both when possible. `fbp` identifies the browser; `fbc` ties to the click. Together they improve attribution and deduplication.

**Can JENTIS stop META JS from creating `fbp`/`fbc`?**\
No. META controls client‑side creation. JENTIS **reads** those values and **persists** them first‑party.

**What happens without META JS?**\
Use **server‑side only** mode: configure **Browser‑ID (Facebook)** to generate/persist a stable browser identifier and **Click‑ID (Facebook)** to capture `fbclid`.

**Will this work under ITP/ETP?**\
Yes, the goal of `jts-fbp`/`jts-fbc` is to **improve survivability** via first‑party, server‑set cookies.
