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

# TikTok Pixel integration

> Add TikTok Pixel to your FunnelFox funnels. Track ad conversions, optimize campaigns, and build custom audiences for TikTok Ads.

The TikTok Pixel integration tracks your funnel events and sends them to TikTok Events Manager. This helps you target ads better and optimize your campaigns on TikTok.

The integration includes two tracking methods:

* **TikTok Pixel event tracking**
* **Events API**

<Frame>
  <img src="https://mintcdn.com/funnelfox/h7zRfisyT68NpzvX/assets/tiktok-pixel.png?fit=max&auto=format&n=h7zRfisyT68NpzvX&q=85&s=64c9902da3f16f81ce60818d2e4d4eb8" width="1920" height="879" data-path="assets/tiktok-pixel.png" />
</Frame>

## TikTok Pixel vs Events API

Here's how these two tracking methods work:

* **TikTok Pixel** is code on your funnel pages that tracks what visitors do and sends this data to TikTok through their browser.
* **Events API** connects FunnelFox servers directly to TikTok, which means events are still tracked even if browser tracking doesn't work.

<Info>
  Events API is recommended alongside TikTok Pixel to maximize performance benefits. Learn more in the [TikTok documentation on Events API](https://ads.tiktok.com/help/article/events-api).
</Info>

## Use Events API

Events API acts as a backup when browser tracking fails or gets blocked.

Here's a common example: When someone buys your product through PayPal, they complete the purchase on PayPal's website, not on your funnel. Some browsers (especially mobile app browsers) can't track this properly, so you might miss the `CompletePayment` event.

Events API solves this problem. When FunnelFox servers get the transaction details from PayPal, they automatically send a `CompletePayment` event to TikTok using Events API. This way, you never miss important conversion data.

## Tracked events

| Event                          | TikTok Pixel Trigger                                                              | Events API Trigger                                                                                          |
| ------------------------------ | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `CompletePayment` (`Purchase`) | User completed checkout (including checkouts that start a free trial)             | FunnelFox received transaction event from PSP (including checkouts that start a free trial)                 |
| `checkout_presented`           | User has opened a screen with checkout<br />**(Can fire multiple times)**         | -                                                                                                           |
| `InitiateCheckout`             | User has seen the checkout element<br />**(Triggers only once per user session)** | -                                                                                                           |
| `CompleteRegistration`         | User completed screen with Authorization element or email input                   | -                                                                                                           |
| `ViewContent`                  | -                                                                                 | FunnelFox detected a paywall view (a plan picker or checkout screen was presented). Can fire multiple times |

<Note>
  In TikTok Events Manager, the `Purchase` event corresponds to the `CompletePayment` event from your funnel. Learn more about [reserved events](https://ads.tiktok.com/help/article/reserved-events?lang=en) in TikTok.
</Note>

## Payment flow events

When customers purchase subscriptions, the event flow varies depending on the purchase type.

Select your PSP below to see how each purchase type triggers TikTok Pixel events for your setup.

<AccordionGroup>
  <Accordion title="Stripe">
    | Purchase type          | Trial start | Conversion / Sub start |   Renewal  |
    | ---------------------- | :---------: | :--------------------: | :--------: |
    | **Subscription only**  |      —      |       `Purchase`       | `Purchase` |
    | **Free trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Paid trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |      —     |
  </Accordion>

  <Accordion title="Paddle">
    | Purchase type          | Trial start | Conversion / Sub start |   Renewal  |
    | ---------------------- | :---------: | :--------------------: | :--------: |
    | **Subscription only**  |      —      |       `Purchase`       | `Purchase` |
    | **Free trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Paid trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |      —     |
  </Accordion>

  <Accordion title="Solidgate">
    | Purchase type          | Trial start | Conversion / Sub start |   Renewal  |
    | ---------------------- | :---------: | :--------------------: | :--------: |
    | **Subscription only**  |      —      |       `Purchase`       | `Purchase` |
    | **Free trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Paid trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |      —     |
  </Accordion>

  <Accordion title="FunnelFox Billing">
    | Purchase type          | Trial start | Conversion / Sub start |   Renewal  |
    | ---------------------- | :---------: | :--------------------: | :--------: |
    | **Subscription only**  |      —      |       `Purchase`       | `Purchase` |
    | **Free trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Paid trial**         |  `Purchase` |       `Purchase`       | `Purchase` |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |      —     |
  </Accordion>
</AccordionGroup>

## Limit purchase events

You can stop sending purchase events after the first one for the same user. But for free trials, FunnelFox will still keep sending the purchase event for trial start and conversion, and only suppress renewals.

To do so, go to **Integrations > TikTok** and toggle on **Limit Purchase Events**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/AyV58J90bPzK4OXx/assets/tiktok-limit-events.png?fit=max&auto=format&n=AyV58J90bPzK4OXx&q=85&s=7288f784f959309b8238cf5a35c6a557" width="1920" height="989" data-path="assets/tiktok-limit-events.png" />
</Frame>

Select your PSP below to see how each purchase type triggers TikTok Pixel events when the toggle is enabled.

<AccordionGroup>
  <Accordion title="Stripe">
    | Purchase type          | Trial start | Conversion / Sub start | Renewal |
    | ---------------------- | :---------: | :--------------------: | :-----: |
    | **Subscription only**  |      —      |       `Purchase`       |    —    |
    | **Free trial**         |  `Purchase` |       `Purchase`       |    —    |
    | **Paid trial**         |  `Purchase` |            —           |    —    |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |    —    |
  </Accordion>

  <Accordion title="Paddle">
    | Purchase type          | Trial start | Conversion / Sub start | Renewal |
    | ---------------------- | :---------: | :--------------------: | :-----: |
    | **Subscription only**  |      —      |       `Purchase`       |    —    |
    | **Free trial**         |  `Purchase` |       `Purchase`       |    —    |
    | **Paid trial**         |  `Purchase` |            —           |    —    |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |    —    |
  </Accordion>

  <Accordion title="Solidgate">
    | Purchase type          | Trial start | Conversion / Sub start | Renewal |
    | ---------------------- | :---------: | :--------------------: | :-----: |
    | **Subscription only**  |      —      |       `Purchase`       |    —    |
    | **Free trial**         |  `Purchase` |       `Purchase`       |    —    |
    | **Paid trial**         |  `Purchase` |            —           |    —    |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |    —    |
  </Accordion>

  <Accordion title="FunnelFox Billing">
    | Purchase type          | Trial start | Conversion / Sub start | Renewal |
    | ---------------------- | :---------: | :--------------------: | :-----: |
    | **Subscription only**  |      —      |       `Purchase`       |    —    |
    | **Free trial**         |  `Purchase` |       `Purchase`       |    —    |
    | **Paid trial**         |  `Purchase` |            —           |    —    |
    | **Lifetime (one-off)** |      —      |       `Purchase`       |    —    |
  </Accordion>
</AccordionGroup>

## Next steps

* [Set up TikTok Pixel integration](/docs/integrations/tracking/set-up-tiktok-pixel)
