> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/integrations-marketingtools/linkedin-ads.md).

# LinkedIn Ads

How to set up tracking for LinkedIn Ads through the LinkedIn Conversions API

The LinkedIn Conversions API sends event data straight from your server to LinkedIn instead of from the visitor's browser. That means less data lost to browser restrictions, adblockers and privacy settings, and a more accurate picture of what your LinkedIn Ads are actually delivering. It supports the events that matter most: page views, purchases and form submissions.

{% hint style="warning" %}
**This article covers a server-side only setup**, with the exception of a LinkedIn Insight Tag on the GTM web container to ensure the `li_fat_id` cookie gets set.
{% endhint %}

### How the setup fits together

There are four parts to this setup, and the order matters because each one produces something the next needs:

1. **In LinkedIn Campaign Manager**, create a conversion and generate an access token.
2. **In your GTM web container**, capture the `li_fat_id` cookie and pass it along with your GA4 events.
3. **In your GTM server container**, add the LinkedIn template and read `li_fat_id` back out of the incoming event data.
4. **Still in the server container**, build a page view tag and one conversion tag per action you want to measure.

***

{% stepper %}
{% step %}

### 1. Create the conversion in LinkedIn Campaign Manager

You need two values from LinkedIn: a **conversion rule ID** and an **access token**.&#x20;

Let's start by creating a new conversion.

1. Log in to the correct account in the LinkedIn Campaign Manager.
2. In the left menu, go to **Measure → Conversion tracking**.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2F2Ku70aPN9Sf8u7m95mK5%2Fimage.png?alt=media&amp;token=f0b0165b-c9cf-4903-8530-8aeb97188ef3" alt=""><figcaption></figcaption></figure>

3. Click **Create conversion → Conversions API**.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FgIBLPJGDAg7fAotssEEB%2Fimage.png?alt=media&amp;token=07dfc301-4c05-4a2a-8870-ba0549c2911c" alt=""><figcaption></figcaption></figure>

4. Fill in the settings:

* **Name** — something you'll recognise later, such as *Purchase* or *Lead*
* **Category** — pick the category that matches the action
* **Value** — optional

5. Continue to the next step and select **Direct API** as the data source.
6. Continue again and create the conversion.
7. Reopen the conversion you just created and look at the browser address bar. The conversion rule ID is the number in the URL after `/conversions/`.&#x20;

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FC2uHA0jO4Fi3vRph1m1K%2Fimage.png?alt=media&amp;token=a18d26bb-e7d6-46fe-81c8-da789fa6bc91" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Generate the API Token

1. In Campaign Manager, go to **Signals manager** under **Data**.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2Fg7l2CoCGX6FcN1NBGymY%2Fimage.png?alt=media&amp;token=e0250054-4925-48e1-a4e5-1cba480f8b80" alt=""><figcaption></figcaption></figure>

2. Open the **Direct API** source.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FnSDD9KXBg4JWAvAMzvGm%2Fimage.png?alt=media&amp;token=2782fcd1-e0dc-47bd-aeb6-64420f6eb420" alt=""><figcaption></figcaption></figure>

3. Click **Generate access token**.
4. Copy the token.
5. Store this API token in a **constant variable** in your GTM server container.
   {% endstep %}

{% step %}

### Capture li\_fat\_id in the web container

`li_fat_id` is LinkedIn's first-party ad tracking ID. It's written as a cookie when someone clicks a LinkedIn ad, and it's what allows LinkedIn to connect a server-side conversion back to that click.

{% hint style="warning" %}
This cookie is not created by the Conversions API itself, it has to be set client-side on your own domain first. The easiest way to set it is to install the **LinkedIn Insight Tag** in your GTM web container. When a visitor arrives from a LinkedIn ad, the Insight Tag reads the `li_fat_id` URL parameter and stores it as a first-party cookie, which your tracking setup can then read and send along with each conversion event.
{% endhint %}

1. Open your GTM **web** container and go to **Variables**.
2. Under **User-Defined Variables**, create a new variable.
3. Choose **1st-Party Cookie** as the variable type.
4. Enter `li_fat_id` as the cookie name.
5. Name the variable `Cookie - li_fat_id` and save.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FHaSj7UAijMPk3CYyzElo%2Fimage.png?alt=media&amp;token=82a22be4-192c-459b-a92f-d9483a728e17" alt=""><figcaption></figcaption></figure>

6. Open your **Google Tag** on the GTM web container.
7. Expand **Configuration parameters**, add a parameter with the name `li_fat_id` and the value `{{Cookie - li_fat_id}}`.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2Fsj5cjHr0mzMPlswkaQEl%2Fimage.png?alt=media&amp;token=704d54e6-6e64-4684-874d-bc8a7abb0098" alt=""><figcaption></figcaption></figure>

8. Save the Google Tag.
9. Open the GTM **server** container.
10. Create a new **Event Data** variable in your server container with `li_fat_id` as the key.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2Fk2v7XK94gIk0jqRlAnIn%2Fimage.png?alt=media&amp;token=8214ccdd-36e0-453c-93e2-78a24e3a249a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add the LinkedIn template to the server container

1. Open your GTM **server** container and click **Templates**.
2. Under **Tag Templates**, click **Search Gallery**.
3. Search for **LinkedIn Conversion API**, select it, and add it to your workspace.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FSGCaZBhZCXI4RpC7jite%2Fimage.png?alt=media&amp;token=823c3cfb-a37d-4545-b2b4-909b2a3319e1" alt=""><figcaption></figcaption></figure>

The LinkedIn integration expects a page view tag alongside your conversions, so set this one up before the conversion tags.

4. Create a new tag in your server container.
5. Choose **LinkedIn Conversion API** as the tag configuration.
6. Set **Event Type** to **Page View**.
7. Attach the **All Pages** trigger and save.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FVYBhANjUUzEpX02Dvsfe%2Fimage.png?alt=media&amp;token=000d0bae-683e-4473-bee2-c3ee6f9a3705" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Set up conversion tags

1. Create a new tag and choose **LinkedIn Conversion API** as the tag configuration.
2. Configure it:
   * **Event Type** — Conversion
   * **Access Token** — your constant variable holding the API token
   * **Conversion Rule ID** — the ID from the URL in step 1
3. For **User IDs**, add an override:
   * Key: `LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID`
   * Value: your `li_fat_id` Event Data variable
4. Attach a trigger that fires when the relevant GA4 event reaches your server container. For example:
   * Purchase conversion → `event_name` equals `purchase`
   * Lead conversion → `event_name` equals `generate_lead`
5. Save the tag.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FsbRSKA0DZmyLwl0BsQRf%2Fimage.png?alt=media&amp;token=c35649f2-92a6-4a75-8c81-3bad21e6c1b8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Test the tags

Run the server container in preview mode and trigger the event on your site. Three things to confirm:

* The LinkedIn conversion tag **fires** on the right event, and only on that event.
* `{ED - li_fat_id}}` **resolves to a value** rather than `undefined`. If it's empty, arrive at your site through an actual LinkedIn ad click first, the cookie won't exist otherwise, and a missing cookie looks identical to a broken variable.
* The outgoing request returns a **success response**. An authentication error here almost always means the token or the conversion rule ID went in wrong.
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}
Conversions won't appear in Campaign Manager instantly, so don't treat an empty report in the first few minutes as a failure.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.adpage.io/integrations-marketingtools/linkedin-ads.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
