> ## 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 TikTok Pixel to OnlyFans API Smart Links (/introduction/guides/tiktok-pixel-smart-links)

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

## What is a TikTok Pixel?

A TikTok Pixel is TikTok's conversion tracking tool. It tells TikTok's ad platform when someone takes a valuable action, like subscribing or making a purchase, after clicking your TikTok ad. This data is what TikTok's algorithm uses to find more users who are likely to convert, which lowers your cost per subscriber over time.

**Why connect it to Smart Links?** OnlyFans doesn't support TikTok's pixel natively, and there's no way to install tracking code on OnlyFans pages. Smart Links bridge the gap by tracking everything **server-side**: every click, subscription, tip, and purchase is sent back to your TikTok Pixel automatically. No JavaScript, nothing to install on OnlyFans.

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

  * An active OnlyFans API account with **Smart Links** enabled
  * A **TikTok Ads Manager** account
  * Your TikTok **Pixel ID** *and* an **Events API Access Token** (we'll generate both below)
</Callout>

## Why this matters for TikTok

TikTok is one of the highest-volume traffic sources for OnlyFans media buyers, and its algorithm is exceptional at finding the right audience. *That only works when it has conversion data to optimize against.*

* **Without conversion data**, TikTok optimizes for video views or clicks. You get cheap traffic that doesn't convert, and cost-per-sub stays unpredictable.
* **With Smart Links + your TikTok Pixel**, every subscription and transaction is sent to TikTok via server-side postbacks. TikTok learns which users actually subscribe and spend, then serves your ads to people who look like your best fans.

TikTok's native pixel is browser-based JavaScript, which makes it vulnerable to ad blockers (especially on mobile, where most TikTok users browse), cross-device loss, and cookie restrictions. Smart Links postbacks bypass all of that: our servers talk directly to TikTok's servers, so events can't be blocked or dropped.

<Callout type="info">
  This guide is the TikTok-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 TikTok Pixel ID

    In [TikTok Ads Manager](https://ads.tiktok.com), open **Tools** in the top navigation and click **Events** (under *Management*).

        <img alt="TikTok Ads Manager: Tools menu with Events highlighted" src={__img0} placeholder="blur" />

    <Callout type="info">
      Depending on your account, TikTok may label this area **Tools → Events** or **Assets → Events → Web Events**. Both lead to the same Events Manager.
    </Callout>

    In Events Manager, click **Get started**, choose **Web** as your data source, and click **Next**.

        <img alt="TikTok Events Manager: Select data source dialog with Web selected" src={__img1} placeholder="blur" />

    Give your pixel a name, select **TikTok Pixel** as the connection method, and continue. Once created, your pixel's **ID** is shown at the top of its **Overview** tab. Copy it.

        <img alt="TikTok pixel Overview tab showing the Pixel ID" src={__img2} placeholder="blur" />
  </Step>

  <Step>
    ### Generate an Access Token

    TikTok's server-side Events API needs an **Access Token** in addition to the Pixel ID. This is how Smart Links authenticate when sending events to TikTok.

    On your pixel, open the **Settings** tab, scroll to **Events API → Access Token Generation**, and click **Generate Access Token**.

        <img alt="TikTok pixel Settings: Events API Generate Access Token button" src={__img3} placeholder="blur" />

    <Callout type="warn">
      Copy the access token immediately and keep it safe. TikTok only shows it once. If you lose it, generate a new one.
    </Callout>
  </Step>

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

    Log into your [OnlyFans API Dashboard](https://app.onlyfansapi.com) and open **Smart Links** in the left sidebar. Click **Create Smart Link** (or open an existing one) and fill in:

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

    <div className="mx-auto max-w-md">
            <img alt="OnlyFans API dashboard: Create Smart Link dialog" src={__img4} placeholder="blur" />
    </div>
  </Step>

  <Step>
    ### Add your TikTok pixel

    On the Smart Link, open the **Connect your ad platforms** panel and click **Add Tracking Pixel** (you can also manage pixels from **Smart Links → Manage Ad Platforms**). Then:

    1. Set **Platform** to **TikTok Ads**
    2. Paste your **Pixel ID** from Step 1
    3. Paste your **Access Token** from Step 2
    4. Review the **Event Configuration**. The defaults are sensible (see [Events sent to TikTok](#events-sent-to-tiktok) below)
    5. Click **Save**

    <div className="mx-auto max-w-md">
            <img alt="OnlyFans API dashboard: Add Tracking Pixel dialog with TikTok Ads selected" src={__img5} placeholder="blur" />
    </div>
  </Step>

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

    If you created the pixel from the **Ad Platforms** page rather than inline, attach it to the Smart Link using the **Ad Platforms** selector on the Smart Link. You can connect more than one pixel to a single link.

    <div className="mx-auto max-w-md">
            <img alt="OnlyFans API dashboard: TikTok pixel attached via the Ad Platforms selector" src={__img6} placeholder="blur" />
    </div>
  </Step>

  <Step>
    ### Send a test event

    In TikTok Ads Manager, open your pixel'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 TikTok, 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={__img7} 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 TikTok.
    </Callout>
  </Step>

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

    In TikTok Ads Manager, set your ad's **Destination URL** to your Smart Link, appending TikTok's click-ID macro so conversions can be matched back to the click:

    ```text
    https://trk.of-traffic.com/go/YOUR_SMART_LINK_ID?ttclid=__CLICKID__
    ```

    Replace `YOUR_SMART_LINK_ID` with the ID from your Smart Links dashboard. TikTok replaces `__CLICKID__` with the click's `ttclid` at click time, and Smart Links reads it straight from the `ttclid` parameter and sends it back to TikTok with every conversion. Keep `?ttclid=__CLICKID__` on the URL, since that's the parameter Smart Links uses for TikTok attribution.
  </Step>

  <Step>
    ### Verify conversions are flowing

    Once your ads are live:

    * **Smart Links dashboard**: you should see clicks, subscribers, and revenue
    * **TikTok Events Manager**: conversion events appearing on your pixel
    * **TikTok Ads Manager**: the campaign's **Conversions** column filling in
  </Step>
</Steps>

## Events sent to TikTok

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

| Smart Link event              | When it fires                                             | TikTok 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**            | Fan's first non-subscription transaction (tip, PPV, etc.) | `CompletePayment`      |
| **Repeat Purchase**           | Any transaction after the first                           | `CompletePayment`      |
| **Message Received from Fan** | Fan sends a message after converting                      | *Not sent by default*  |
| **Fan Sent 3+ Messages**      | Fan reaches their 3rd inbound message                     | *Not sent by default*  |

<Callout type="info">
  For subscriber and purchase events, Smart Links also sends the conversion **value** and **currency** when available, so TikTok can optimize toward your highest-value fans, not just any conversion.
</Callout>

## Troubleshooting

| Problem                                         | Fix                                                                                                                                                            |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| No events showing in TikTok                     | Double-check you pasted **both** the Pixel ID and the Access Token. TikTok's server-side Events API needs both to authenticate.                                |
| Test event never appears                        | A **Test Event Code** is required for TikTok. Copy it from your pixel'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 group's optimization goal to the matching conversion event (e.g. `CompletePayment` or `Subscribe`).                                                |
| High traffic but low conversions                | TikTok traffic is high-volume. Give the pixel **50+ conversions** before judging so the algorithm has enough data to learn from.                               |