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

# X Ads Setup

> Connect your X ad account and add Northbeam parameters so spend and revenue line up.

When you're done, Northbeam shows your X spend, impressions, visits, and attributed revenue on the same campaigns, ad groups, and ads.

<Info>
  **Before you start**, make sure you have:

  * An X login with **admin access** to the ad account
  * Access to **X Ads Manager** to edit your ads
</Info>

<CardGroup cols={3}>
  <Card title="1. Connect the account" icon="plug" href="#connect-your-x-ad-account">
    Sync spend, impressions, and campaign structure from X.
  </Card>

  <Card title="2. Add Northbeam parameters" icon="link" href="#add-northbeam-parameters-to-your-ads">
    Add nine values in Add URL tracking so visits and orders tie back to your ads.
  </Card>

  <Card title="3. Confirm tracking" icon="circle-check" href="#confirm-tracking">
    Click a live ad and check the landing page URL.
  </Card>
</CardGroup>

<Steps titleSize="h2">
  <Step title="Connect your X ad account">
    1. Open [Connections](https://dashboard.northbeam.io/settings/connections). If you're still in onboarding, go to **Integrations** instead.
    2. Find **X Ads** and click **Connect**.
    3. Sign in to X with the admin login.

    The connection pulls your current and historical campaigns, ad groups, and ads from the X Ads API, along with spend, impressions, and X-reported conversion and creative metrics. Impressions power the **Clicks + Modeled Views** attribution model.

    **If you skip this step:** campaign, ad group, and ad names are missing, along with spend and impressions.
  </Step>

  <Step title="Add Northbeam parameters to your ads">
    <span id="step-2-insert-northbeam-utm-parameters" style={{ display: "block", scrollMarginTop: "7rem" }} />

    In X Ads Manager, open **Add URL tracking** on every ad and fill in all nine values below. Northbeam needs all of them to match your X traffic to spend. You can also copy each one from your [UTM Guide](https://dashboard.northbeam.io/settings/utm-guide) in Northbeam.

    | Field | Value |
    | :- | :- |
    | **Source** | `twitter` |
    | **Medium** | `paid` |
    | **Name** | `{{campaign_name}}` |
    | **Term** | `{{adgroup_name}}` |
    | **Content** | `{{ad_name}}` |
    | `x_campaign_id` | `{{campaign_id}}` |
    | `x_adgroup_id` | `{{adgroup_id}}` |
    | `x_ad_id` | `{{ad_id}}` |
    | `nb_platform` | `x` |

    The first five are the standard fields at the top of the panel. Add the last four under **Custom parameters** by clicking **Add custom parameter** for each.

    <Frame caption="Add URL tracking with all nine values filled in">
      <img src="https://mintcdn.com/northbeam/7SgttEFfbWe361xL/images/x/url-tracking.png?fit=max&auto=format&n=7SgttEFfbWe361xL&q=85&s=e822e2e36b7674b7b1bd8b5aa7b68cff" alt="X Ads Manager Add URL tracking panel with Source twitter, Medium paid, Name {{campaign_name}}, Term {{adgroup_name}}, Content {{ad_name}}, and custom parameters x_campaign_id, x_adgroup_id, x_ad_id, and nb_platform filled in" style={{ maxWidth: "320px", width: "100%", height: "auto", margin: "0 auto" }} width="442" height="815" data-path="images/x/url-tracking.png" />
    </Frame>

    Your final URL looks like:

    ```text theme={null}
    https://www.yoursite.com/?utm_source=twitter&utm_medium=paid&utm_campaign={{campaign_name}}&utm_term={{adgroup_name}}&utm_content={{ad_name}}&x_campaign_id={{campaign_id}}&x_adgroup_id={{adgroup_id}}&x_ad_id={{ad_id}}&nb_platform=x
    ```

    <Note>
      Published ads can't be edited. To add the parameters to an existing ad, duplicate it and add them to the new copy.
    </Note>

    **If you skip this step:** Northbeam can't tie visits and orders to your X ads, so spend and revenue show up on separate lines.
  </Step>

  <Step title="Confirm tracking">
    **Quick check:** click one of your live X ads and look at the landing page URL. You should see real IDs, like `x_campaign_id=1234567890`.

    <Warning>
      If the URL shows the literal text `{{campaign_id}}`, or the parameters are missing, check the values in **Add URL tracking** against the table above.
    </Warning>

    For a full check:

    * **Parameters captured:** follow [Checking UTM tracking](/docs/checking-utm-tracking) to confirm the Northbeam parameters reach your landing pages.
    * **Connection syncing:** follow [Checking platform connections](/docs/checking-api-connections) to confirm the account shows as connected and data is arriving.
  </Step>
</Steps>

## Need help?

<CardGroup cols={2}>
  <Card title="X Ads FAQ" icon="circle-question" href="/docs/channels/x/faq">
    Adding accounts, and why X and Northbeam numbers differ.
  </Card>

  <Card title="Troubleshooting Northbeam data" icon="wrench" href="/docs/troubleshooting-tracking-issues">
    Start here if a check above fails.
  </Card>
</CardGroup>
