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

# Twitter (X Ads)

> Connect X Ads (formerly Twitter Ads) to SegmentStream and import campaign cost data.

## Getting started

<Steps>
  <Step title="Navigate to Data Sources">
    Inside the admin panel navigate to the **Data Sources** page and click **+ NEW** on the top right corner.
  </Step>

  <Step title="Select Twitter (X Ads)">
    Choose **Twitter (X Ads)** from the list.
  </Step>

  <Step title="Authenticate">
    Click **Authenticate with Twitter (X Ads)** and go through the authentication flow.
  </Step>

  <Step title="Select accounts">
    Select the accounts you would like to connect.
  </Step>

  <Step title="Save">
    Click **Save**.
  </Step>
</Steps>

## UTM tagging best practices

Since X Ads do not support dynamic UTM parameters, you must manually input the campaign and ad group names as tracking parameters in the website URL of your promoted post. This manual entry is essential for SegmentStream to accurately attribute ad platform clicks to sessions on your website.

<Steps>
  <Step title="Go to Legacy Ads Manager">
    Go to your Ads Manager, and click **Go to Legacy**.
  </Step>

  <Step title="Open Ad groups tab">
    Select the **Ad groups** tab and click on **Metrics: Summary** > **Customise metrics**.
  </Step>

  <Step title="Select metrics">
    Select the **Ad Group ID** and **Campaign ID** metrics and click **Apply**.
  </Step>

  <Step title="Note the IDs">
    Find the ad group you want to track and note the **Ad Group ID** and **Campaign ID** values (for example, `47604328` and `36868108`).
  </Step>

  <Step title="Edit ad group">
    Click on the more options icon next to your ad group name and click **Edit ad group**.
  </Step>

  <Step title="Edit website URL">
    Edit the **Website URL** field for each ad within the ad group.
  </Step>

  <Step title="Add utm_id parameter">
    Add the `utm_id` parameter to the URL, combining the Campaign ID and Ad Group ID with an underscore. For example:

    ```plain text theme={null}
    https://segmentstream.com?utm_source=x&utm_medium=paid-social&utm_campaign=Offers&utm_id=36868108_47604328
    ```
  </Step>
</Steps>

Once the parameters are implemented, sessions will be linked with costs down to the ad group level, and SegmentStream reports will display the X Ads campaign name and ad group name accordingly.
