# Event Setup

With your **Pixel ID** and **Conversion API** activated, the next step is to define the **events** that JENTIS should send to Meta. Events describe what happened on your website (e.g., a purchase, a form submission, or a page view).

### 1. Align Events with Business Goals

Before configuring anything in JENTIS:

* Review your **business requirements**.
* Decide **which visitor interactions** should be tracked (e.g., `Purchase`, `Lead`, `AddToCart`).
* Ensure that legal aspects (e.g., handling PII) are considered.

### 2. Define Events in Meta Business Manager

1. Go to [Meta Business Manager](https://business.facebook.com/) → **Events Manager**.
2. Select your **Pixel ID**.
3. In the **Events Setup**, choose which events to configure:
   * Standard events (e.g., `Purchase`, `Lead`, `PageView`)
   * Custom events (e.g., `NewsletterSignup`)

### 3. Configure Event Parameters

Each event requires **parameters** to provide additional context:

* **Standard Parameters** (handled automatically by JENTIS if activated):
  * `external_id` (internal user reference)
  * `fbc` (Meta Click ID cookie)
  * `fbp` (Meta Browser ID cookie)
  * `event_id` (Deduplication-ID)
* **Optional Parameters** (depending on business needs):
  * `email` (must be **hashed**)
  * `phone` (hashed)
  * `ip_address`, `user_agent`
  * product details (e.g., `value`, `currency`, `content_ids`)

Example configuration in Events Manager:

```
Event: Purchase
Parameters: value, currency, external_id, fbc, fbp, email
```

### 4. Handling Personally Identifiable Information (PII)

* Meta requires **PII values** (e.g., email, phone) to be **hashed** before submission.
* JENTIS will forward them as provided.
* Always hash data client-side before pushing it to JENTIS.

Example (pseudo-code, **do not run**):

```js
var emh = sha256("mail@address.com");

_jts.push({
  "track": "event",
  "group": "fbpii",
  "name": "purchase",
  "emh": emh
});
```

### 5. Confirm in Meta

After configuring events:

* Meta Events Manager will display each event.
* Ensure parameters are received and mapped correctly.
* Use the **Test Event Code** for real-time debugging before going live.

{% hint style="success" %}
Now your events and parameters are defined in Meta.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jentis.com/data-activation/connectors/meta/event-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
