# Meta Ads

After setting up your project on **Zotlo**, you can integrate **Meta Ads** to enhance your advertising strategies and optimize campaign performance. This integration leverages both **Meta Pixel** and **Meta Conversions API (CAPI)** to ensure data accuracy and improved attribution.

## Pixel vs. CAPI

To maximize your ad efficiency, Zotlo supports both browser-based and server-side tracking mechanisms.

| Feature            | Meta Pixel (Browser-Side)                          | Meta CAPI (Server-Side)                                  |
| ------------------ | -------------------------------------------------- | -------------------------------------------------------- |
| **Mechanism**      | Tracks activity via the user's web browser.        | Sends data directly from Zotlo’s server to Meta.         |
| **Data Source**    | Relies on third-party cookies.                     | Relies on first-party data and server events.            |
| **Privacy Impact** | Affected by ad-blockers and ITP (browser privacy). | Bypasses ad-blockers and browser-based restrictions.     |
| **Reliability**    | May result in data gaps due to cookie loss.        | Provides higher data integrity and accurate attribution. |

{% hint style="success" %}
**Why use both?** Utilizing a hybrid setup (Pixel + CAPI) creates a redundant and robust tracking environment. While Meta Pixel captures behavioral data on-site, CAPI ensures that conversion events are recorded reliably, even when browser-based tracking is blocked.
{% endhint %}

## Integration Steps

Follow these steps to activate the Meta Ads integration within your **Zotlo Panel**:

1. **Navigate to Integrations:** Open the settings page of your Zotlo panel, click the "Integrations" tab.
2. **Select Meta Ads:** Find and select **"Meta Ads"** from the list of available integrations.
3. **Configure Settings:** Enable the integration and choose your preferred tracking type by filling in the required fields:

* **If you want to send only Pixel events:** You only need to fill in the **`Pixel ID`** field.
  * *Where to find:* In **Meta Events Manager**, go to **Data Sources**, select your Pixel, and copy the **ID** shown under the Pixel name.
* **If you want to send both Pixel and CAPI events (Recommended):** You must fill in both the **`Pixel ID`** and the **`Access Token`** fields.
  * *How to generate Access Token:* In **Meta Events Manager**, go to the **Settings** tab of your Pixel. Scroll down to the **Conversions API** section and click **"Generate access token"** under the manual setup heading.

## Tracked Events

The integration automatically sends the following events to Meta. Please note the difference between Pixel and CAPI event coverage:

<table><thead><tr><th width="204.00091552734375">Event Name</th><th align="center">Sent via Pixel</th><th align="center">Sent via CAPI</th><th>Trigger Description</th></tr></thead><tbody><tr><td><strong>PageView</strong> (All Pages)</td><td align="center">✅</td><td align="center">✅</td><td>Triggered for every page load.</td></tr><tr><td><strong>Purchase</strong></td><td align="center">✅</td><td align="center">✅</td><td>Triggered after a successful payment.</td></tr><tr><td><strong>InitiateCheckout</strong></td><td align="center">✅</td><td align="center">❌</td><td>Triggered when the pay button is clicked, before gateway response.</td></tr><tr><td><strong>AddToCart</strong></td><td align="center">✅</td><td align="center">❌</td><td>Triggered when the payment page is viewed.</td></tr><tr><td><strong>AddPaymentInfo</strong></td><td align="center">✅</td><td align="center">❌</td><td>Triggered when the payment page is viewed.</td></tr><tr><td><strong>CompleteRegistration</strong></td><td align="center">✅</td><td align="center">❌</td><td>Triggered after a successful registration.</td></tr><tr><td><strong>Lead</strong></td><td align="center">✅</td><td align="center">❌</td><td>Triggered when the first page of the onboarding funnel is viewed.</td></tr></tbody></table>

## Post-Integration Checklist

**Send CAPI Test Events**

&#x20;To ensure your Server-Side (CAPI) integration is working correctly, you should perform a test:

1. In **Meta Events Manager**, navigate to the **"Test Events"** tab of your Pixel.
2. Look for the **"Test Server Events"** section and copy the **Test Event Code** (e.g., `TEST12345`).
3. Return to your **Zotlo Panel** and find the **"Send CAPI Test Event"** section.
4. Paste your code into the **Test Event Code** field and click **Send**.
5. Go back to Meta Events Manager to confirm that the test event appears in the activity log with the "Server" source.<br>

## **Verification**

After completing the setup, visit the **Meta Events Manager** to verify that events  are being received. Meta automatically deduplicates these events when both Pixel and CAPI are active.
