OnlyFans API

Connect your TikTok Pixel to OnlyFans API Smart Links

Send every OnlyFans subscription, purchase, and message event straight to your TikTok Pixel with server-side postbacks. No JavaScript, nothing to install on OnlyFans.

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.

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)

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.

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.

Step-by-step setup

Find your TikTok Pixel ID

In TikTok Ads Manager, open Tools in the top navigation and click Events (under Management).

TikTok Ads Manager: Tools menu with Events highlighted

Depending on your account, TikTok may label this area Tools → Events or Assets → Events → Web Events. Both lead to the same Events Manager.

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

TikTok Events Manager: Select data source dialog with Web selected

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.

TikTok pixel Overview tab showing the Pixel ID

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.

TikTok pixel Settings: Events API Generate Access Token button

Copy the access token immediately and keep it safe. TikTok only shows it once. If you lose it, generate a new one.

Log into your OnlyFans API Dashboard 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

OnlyFans API dashboard: Create Smart Link dialog

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 below)
  5. Click Save

OnlyFans API dashboard: Add Tracking Pixel dialog with TikTok Ads selected

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.

OnlyFans API dashboard: TikTok pixel attached via the Ad Platforms selector

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.

OnlyFans API dashboard: Send Test Event dialog with a test event code

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.

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:

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.

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

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 eventWhen it firesTikTok event (default)
ClickFan clicks the Smart Link and is redirected to OnlyFansViewContent
New SubscriberFan subscribes through the Smart LinkSubscribe
First PurchaseFan's first non-subscription transaction (tip, PPV, etc.)CompletePayment
Repeat PurchaseAny transaction after the firstCompletePayment
Message Received from FanFan sends a message after convertingNot sent by default
Fan Sent 3+ MessagesFan reaches their 3rd inbound messageNot sent by default

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.

Troubleshooting

ProblemFix
No events showing in TikTokDouble-check you pasted both the Pixel ID and the Access Token. TikTok's server-side Events API needs both to authenticate.
Test event never appearsA 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 optimizingSet your ad group's optimization goal to the matching conversion event (e.g. CompletePayment or Subscribe).
High traffic but low conversionsTikTok traffic is high-volume. Give the pixel 50+ conversions before judging so the algorithm has enough data to learn from.

On this page