> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onlyfansapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect your Meta Pixel to OnlyFans API Smart Links (/introduction/guides/meta-pixel-smart-links)

import { Step, Steps } from "fumadocs-ui/components/steps";

## What is a Meta Pixel?

A Meta Pixel (now called a *dataset* in Events Manager) is Meta's conversion tracking tool for Facebook and Instagram ads. It tells Meta when someone takes an action, such as subscribing or purchasing, after clicking your ad.

**Why connect it to Smart Links?** OnlyFans doesn't support Meta's pixel natively, and there's no way to install tracking code on OnlyFans pages. Smart Links can send the events you configure to Meta's Conversions API without installing JavaScript on OnlyFans.

<Callout>
  **What you'll need**

  * An active OnlyFans API account with **Smart Links** enabled
  * A **Meta Business** account with access to **Events Manager**
  * Your Meta **Pixel ID** *and* a **Conversions API access token** (we'll get both below)
</Callout>

## Why this matters for Meta

Meta cannot observe subscriptions, tips, PPV purchases, or replies on OnlyFans through browser JavaScript. Smart Links sends configured events from OnlyFansAPI's servers instead. Delivery can still fail because of invalid credentials, rejected payloads, or platform availability; inspect the pixel's event logs in OnlyFansAPI.

<Callout type="info">
  This guide is the Meta-specific setup. For how Smart Links work under the hood, including attribution rules, the conversion window, lifetime revenue attribution, and postback variables, see the [Smart Links guide](/introduction/guides/onlyfans-meta-pixel-smart-links).
</Callout>

## Step-by-step setup

<Steps>
  <Step>
    ### Find your Meta Pixel ID

    In [Meta Events Manager](https://business.facebook.com/events_manager), open the **All Tools** menu and select **Events Manager**.

        <img alt="Meta Business: All Tools menu with Events Manager" src={__img0} placeholder="blur" />

    In Events Manager, open **Data Sets** and select your dataset. Your **Pixel ID** (also called the *Dataset ID*) is shown next to the dataset name. Copy it, then open the **Settings** tab to grab the access token next.

        <img alt="Meta Events Manager: Datasets with the Settings tab highlighted" src={__img1} placeholder="blur" />

    <Callout type="info">
      If you manage multiple businesses or clients, make sure you've selected the correct **Business** and **Pixel/Dataset** before copying the ID and generating the token below.
    </Callout>
  </Step>

  <Step>
    ### Generate a Conversions API access token

    Meta's server-side Conversions API needs an **access token** in addition to the Pixel ID. This is how Smart Links authenticate when sending events to Meta.

    With your dataset selected, open the **Settings** tab, scroll to the **Conversions API** section, and click **Generate access token**.

        <img alt="Meta Events Manager: Conversions API Generate access token" src={__img2} placeholder="blur" />

    <Callout type="warn">
      Copy the access token and keep it safe, and treat it like a password. Make sure the correct Pixel/Dataset is selected before generating, or the token won't match the Pixel ID you copied.
    </Callout>
  </Step>

  <Step>
    ### Create or open a Smart Link

    Log into your [OnlyFans API Dashboard](https://app.onlyfansapi.com), open **Smart Links → Links**, and click **Create Smart Link**. To use an existing link, open its action menu and click **Edit**.

    * **Account**: the OnlyFans account you're running ads for
    * **Smart Link Name**: something descriptive, e.g. your Meta campaign name
    * **Offer Type**: *Free Trial* or *Tracking Link*
  </Step>

  <Step>
    ### Add your Meta pixel

    Open **Smart Links → Tracking Pixels** and click **Add Pixel**. In the **Add Tracking Pixel** dialog:

    1. Set **Platform** to **Meta Ads**
    2. Paste your **Pixel ID** from Step 1
    3. Paste your **Conversions API access token** from Step 2 into the **Access Token** field
    4. Choose **All traffic sources**, or [create matching rules](/introduction/guides/onlyfans-meta-pixel-smart-links#traffic-sources) and scope the pixel to specific traffic sources
    5. Review the **Event Configuration** (see [Events sent to Meta](#events-sent-to-meta) below)
    6. Click **Create**
  </Step>

  <Step>
    ### Attach the pixel to your Smart Link

    Open **Smart Links → Links**, edit the Smart Link, and select the pixel in **Tracking Pixels**. You can attach more than one pixel to a link.
  </Step>

  <Step>
    ### Send a test event

    In Meta Events Manager, open your dataset's **Test Events** tab and copy the **test event code**.

    Back in the OnlyFans API Dashboard, open the **Send Test Event** dialog on your pixel, pick an **Event**, paste the **Test Event Code**, and send it. Then check the **Test Events** tab in Meta, where your event should appear within a few minutes.

    <div className="mx-auto max-w-md">
            <img alt="OnlyFans API dashboard: Send Test Event dialog with a test event code" src={__img3} placeholder="blur" />
    </div>

    <Callout>
      Events sent with a test event code don't affect your live data. They're only for verifying the connection. The Test Event Code is **required** for Meta.
    </Callout>
  </Step>

  <Step>
    ### Use the Smart Link in your Meta ad

    In Meta Ads Manager, set your ad's **Website URL** to your Smart Link:

    ```text
    https://trk.of-traffic.com/go/YOUR_SMART_LINK_ID?ecid={{ad.id}}
    ```

    Replace `YOUR_SMART_LINK_ID` with the ID from your Smart Links dashboard. Meta automatically appends its click ID (`fbclid`) to the destination URL, and Smart Links reads it straight from the `fbclid` parameter to attribute conversions to your Meta Pixel. There's no macro to add for pixel tracking.

    The optional `?ecid={{ad.id}}` parameter passes Meta's Ad ID as your external click ID so you can match conversions back to specific ads in your own reporting. Swap in `{{campaign.id}}`, `{{adset.id}}`, or any other Meta dynamic parameter for the level of granularity you need.
  </Step>

  <Step>
    ### Verify conversions are flowing

    Once your ads are live:

    * **Smart Links dashboard**: you should see clicks, subscribers, and revenue
    * **Meta Events Manager**: conversion events appearing on your pixel (check the **Overview** and **Test Events** tabs)
    * **Meta Ads Manager**: the campaign's **Results** column filling in with tracked conversions
  </Step>
</Steps>

## Events sent to Meta

Smart Links can send the following events to your Meta Pixel. Each one maps to a Meta event in the **Event Configuration** section when you add the pixel. These are the defaults, and every event is configurable (map it to any Meta standard event, a custom event, or turn it off).

| Smart Link event              | When it fires                                                                                            | Meta event (default)  |
| ----------------------------- | -------------------------------------------------------------------------------------------------------- | --------------------- |
| **Click**                     | Fan clicks the Smart Link and is redirected to OnlyFans                                                  | `ViewContent`         |
| **New Subscriber**            | Fan subscribes through the Smart Link                                                                    | `Subscribe`           |
| **First Purchase**            | First transaction other than the initial new-subscription payment. A rebill can be first.                | `Purchase`            |
| **Repeat Purchase**           | Other transactions, including the initial new-subscription payment and transactions after First Purchase | `Purchase`            |
| **Message Received from Fan** | Fan sends a message after converting                                                                     | *Not sent by default* |
| **Fan Sent 1st Message**      | Fan reaches their 1st inbound message                                                                    | `Contact`             |
| **Fan Sent 3+ Messages**      | Fan reaches their 3rd inbound message                                                                    | `Lead`                |

<Callout type="info">
  For subscriber and purchase events, Smart Links also sends the conversion **value** and **currency** when available.
</Callout>

### Custom event mapping

The **Event Configuration** lets you map each Smart Link event to any Meta standard event, a custom event, or turn it off—so if the defaults don't match how you've set up your pixel, remap them.

For example, to send `CompleteRegistration` instead of `Subscribe`: open the pixel's **Event Configuration**, find **New Subscriber**, and set its Meta event to `CompleteRegistration`. Pick a custom event if you'd rather send an event name of your own.

## Data sent to Meta

Smart Links sends `fbc` derived from `fbclid`, `fbp`, a hashed `external_id` derived from `ecid`, the visitor's IP address and user agent, and hashed country, city, state, and postal code when available. It does not send the fan's email, phone number, or name to Meta. Meta calculates match quality from the data it receives; inspect Events Manager for the result on your dataset.

## Troubleshooting

| Problem                                              | Fix                                                                                                                                                                                                                       |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| No events showing in Meta                            | Double-check you pasted **both** the Pixel ID and the Conversions API access token, and that the token was generated for the **same** Pixel/Dataset as the ID.                                                            |
| Test event never appears                             | A **Test Event Code** is required for Meta. Copy it from your dataset's **Test Events** tab and paste it into the Send Test Event dialog. Allow a few minutes.                                                            |
| Events arrive but the campaign isn't optimizing      | Set your ad set's optimization goal to the matching conversion event (e.g. `Purchase` or `Subscribe`).                                                                                                                    |
| Meta shows the pixel as inactive                     | Send a test event from **Smart Links → Tracking Pixels**, then check the dataset's **Overview** tab.                                                                                                                      |
| Which domain do I whitelist for the Conversions API? | None. OnlyFansAPI sends events directly to Meta. Visitors still use your landing-page domain, if any, and `trk.of-traffic.com` for the Smart Link redirect.                                                               |
| Conversions underreported from Instagram traffic     | Confirm every landing-page hop forwards `fbclid`, `ecid`, and UTM parameters. Built-in Smart Links pre-landers forward these values; see [Pre-landers](/introduction/guides/onlyfans-meta-pixel-smart-links#pre-landers). |