> ## 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.

# How to set up X (Twitter) Pixel

> Add X (Twitter) Pixel to your FunnelFox funnels. Track conversions, build audiences, and optimize your X ad campaigns.

The [X Pixel integration](/integrations/tracking/x-pixel) sends events like `Purchase` and `CompleteRegistration` to X Events Manager, helping you optimize your ads on X (formerly Twitter).

Conversion API sends events directly from FunnelFox servers to X, bypassing browser limitations. This guide walks you through the complete setup process.

<Info>
  We strongly recommend using Conversion API. If you're unsure whether you need it, read our guide on
  [why use Conversion API](/integrations/tracking/x-pixel#use-conversion-api).
</Info>

## Setup

To proceed with this setup, make sure you have:

* An X Ads Manager account with the Tools tab available. [X locks the Tools tab](https://business.x.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites) until a credit card is added to your X account.

* Ads API access to set up the Conversion API. Learn more in the [X documentation about Ads API](https://developer.x.com/en/docs/x-ads-api/getting-started).

Follow these steps to create an X Pixel, get your Pixel ID, and connect it to FunnelFox.

### 1. Add event source

1. Go to **Tools > Event manager** in your [X Ads Manager](https://ads.x.com).

<Note>If your X Pixel was already created for your ad campaigns, you can skip steps 2 and 3 in this subsection.</Note>

2. Click **Add event source** at the top right.

<Frame>
  <img src="https://mintcdn.com/funnelfox/L_frWgq5PPmYz0Et/assets/add-event-source.png?fit=max&auto=format&n=L_frWgq5PPmYz0Et&q=85&s=9ffa4d7bf75ebcb1987c539996a2df84" width="1920" height="879" data-path="assets/add-event-source.png" />
</Frame>

3. Save the event source.

### 2. Add events

1. Click **Add events** on the right.

<Frame>
  <img src="https://mintcdn.com/funnelfox/L_frWgq5PPmYz0Et/assets/add-events.png?fit=max&auto=format&n=L_frWgq5PPmYz0Et&q=85&s=2ec241741e495abb2b004abd4a31eeb1" width="1920" height="879" data-path="assets/add-events.png" />
</Frame>

2. Enter event details and click **Next**:

* **Name**: Page view
* **Event type**: Page view (formerly site visit)
* **Post-engagement attribution window**: 30 days (default)
* **Post-view attribution window**: 1 day (default)

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-event-details.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=cdf4c1a4cbb84814a2fe28fe742379f9" width="1920" height="879" data-path="assets/x-event-details.png" />
</Frame>

3. Keep the default **Define event with code** as setup method and click **Next**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-setup-method.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=1a4711e91d448b1f0422c5ae0125393d" width="1920" height="879" data-path="assets/x-setup-method.png" />
</Frame>

4. Click **Save** under **Event installation** as you don't have to set up anything here.

<Frame>
  <img src="https://mintcdn.com/funnelfox/bcVKqISdSCE1IJ_6/assets/event-installation.png?fit=max&auto=format&n=bcVKqISdSCE1IJ_6&q=85&s=9847d3cdc05f11bde9922396884cf40b" width="1920" height="879" data-path="assets/event-installation.png" />
</Frame>

5. Repeat to add the following three events:

**Complete Registration**

* **Name**: Complete Registration
* **Event type**: Lead (formerly sign up)
* **Post-engagement attribution window**: 30 days (default)
* **Post-view attribution window**: 1 day (default)

**Initiate Checkout**

* **Name**: Initiate Checkout
* **Event type**: Checkout initiated
* **Post-engagement attribution window**: 30 days (default)
* **Post-view attribution window**: 1 day (default)

**Purchase**

* **Name**: Purchase
* **Event type**: Purchase
* **Post-engagement attribution window**: 30 days (default)
* **Post-view attribution window**: 1 day (default)

<Note>Each created event gets a unique ID. Use these event IDs when configuring the next step.</Note>

<Tip>Keep this page open since you’ll need to copy and paste multiple values into FunnelFox.</Tip>

<Frame>
  <img src="https://mintcdn.com/funnelfox/bcVKqISdSCE1IJ_6/assets/event-id.png?fit=max&auto=format&n=bcVKqISdSCE1IJ_6&q=85&s=cdc9ea04e161e522033eb8d3a0826541" width="1920" height="879" data-path="assets/event-id.png" />
</Frame>

### 3. Configure events

1. Go to [Integrations > X](https://app.funnelfox.com/integrations/x) in FunnelFox.

2. Insert your event IDs into the corresponding fields under **X Pixel Event IDs Configuration**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/QcqHOia_yy8h3Fi2/assets/x-event-configuration.png?fit=max&auto=format&n=QcqHOia_yy8h3Fi2&q=85&s=0c87187e5ba76a57397727207bea86b3" width="1920" height="879" data-path="assets/x-event-configuration.png" />
</Frame>

### 4. Configure Pixel ID

1. Go back to Events manager in X and copy your 5-character **Pixel ID**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-copy-pixel.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=c81e9f343467fbc80d58f075359a1315" width="1920" height="879" data-path="assets/x-copy-pixel.png" />
</Frame>

2. Go to X Pixel integration in FunnelFox and paste the Pixel ID under the **X Pixel ID**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/QcqHOia_yy8h3Fi2/assets/x-paste-pixel.png?fit=max&auto=format&n=QcqHOia_yy8h3Fi2&q=85&s=75950426862ba5900e127bd540b3264f" width="1920" height="879" data-path="assets/x-paste-pixel.png" />
</Frame>

### 5. Configure Conversion API

1. Go to your [X Developer Portal](https://developer.x.com/en/portal/dashboard) and click the key icon under your project.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-key.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=f76f77126020b2b8b03a34b7ea380c15" width="1920" height="879" data-path="assets/x-key.png" />
</Frame>

2. Click **Regenerate** for your **API key and Secret**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-key-regenerate.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=a5dca7ada0356926dae70373a4d622ec" width="1920" height="879" data-path="assets/x-key-regenerate.png" />
</Frame>

3. Copy the **API Key**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-copy-api.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=cb5b1da7422c7a79a33b11ced7505917" width="1920" height="879" data-path="assets/x-copy-api.png" />
</Frame>

4. Go back to X Pixel integration in FunnelFox and paste the API key into the **API Token** field.

<Frame>
  <img src="https://mintcdn.com/funnelfox/QcqHOia_yy8h3Fi2/assets/x-paste-api-key.png?fit=max&auto=format&n=QcqHOia_yy8h3Fi2&q=85&s=e644ef35a83ff00f1efcb2b83d7e07cb" width="1920" height="879" data-path="assets/x-paste-api-key.png" />
</Frame>

5. Copy the **API Key Secret** in X Developer Portal and click **Yes, I saved them**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-copy-secret.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=ed79601b05c903fcd0d4c0d95fab396a" width="1920" height="879" data-path="assets/x-copy-secret.png" />
</Frame>

6. Paste the API Key Secret into the **Api Key Secret** field in FunnelFox.

<Frame>
  <img src="https://mintcdn.com/funnelfox/QcqHOia_yy8h3Fi2/assets/x-paste-secret.png?fit=max&auto=format&n=QcqHOia_yy8h3Fi2&q=85&s=621f664586b92cb7a28852319fb9ee9c" width="1920" height="879" data-path="assets/x-paste-secret.png" />
</Frame>

7. Go back to X Developer Portal and click **Generate** for your **Access Token and Secret**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-generate.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=14993d381f9fa3c1cd90d7a6417b0921" width="1920" height="879" data-path="assets/x-generate.png" />
</Frame>

8. Copy the **Access Token**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-copy-access-token.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=a799a2bd178391a57980f214d96a7e61" width="1920" height="879" data-path="assets/x-copy-access-token.png" />
</Frame>

9. Paste the Access Token into the **OAuth Token** field in FunnelFox.

<Frame>
  <img src="https://mintcdn.com/funnelfox/QcqHOia_yy8h3Fi2/assets/x-paste-oauth.png?fit=max&auto=format&n=QcqHOia_yy8h3Fi2&q=85&s=c5c5546c16a0f819cd42fadf049f2a19" width="1920" height="879" data-path="assets/x-paste-oauth.png" />
</Frame>

10. Copy the **Access Token Secret** in X Developer Portal and click **Yes, I saved them**.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-copy-token-secret.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=6b69b5881772c9644c56320ed7db2484" width="1920" height="879" data-path="assets/x-copy-token-secret.png" />
</Frame>

11. Paste the Access Token Secret into the **OAuth Token Secret** field in FunnelFox.

<Frame>
  <img src="https://mintcdn.com/funnelfox/QcqHOia_yy8h3Fi2/assets/x-paste-token-secret.png?fit=max&auto=format&n=QcqHOia_yy8h3Fi2&q=85&s=938fce4a5d18f5feedddadb391800044" width="1920" height="879" data-path="assets/x-paste-token-secret.png" />
</Frame>

12. Click **Save changes**.

<Check>X Pixel and Conversion API are now active! Republish your funnels to start tracking.</Check>

## Test your integration

Test that your event tracking works by sending test events from your funnel:

1. Open your published funnel in a browser.

2. Interact with your funnel (view checkout, complete registration, or make a purchase).

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-test.gif?s=6ee8953198d7c29c6e5ee74d6dfc03b3" width="1920" height="880" data-path="assets/x-test.gif" />
</Frame>

3. Open your pixel in X Events Manager. Events should show as **Active** and appear in the **Last recorded** column.

<Frame>
  <img src="https://mintcdn.com/funnelfox/7RjRLWo5BVK8z5cz/assets/x-test-result.png?fit=max&auto=format&n=7RjRLWo5BVK8z5cz&q=85&s=1f5f5a1a11e6b35b9e7028a7d28de169" width="1920" height="879" data-path="assets/x-test-result.png" />
</Frame>

<Tip>If events aren't appearing, make sure you've republished your funnel after adding the X Pixel credentials.</Tip>
