> Part of the walkerOS documentation. Project overview and full index: <https://www.walkeros.io/llms.txt>

# LinkedIn Conversions API

<!-- -->

[Server](#)[ ](https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/linkedin)

<!-- -->

[Source code](https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/linkedin)[ ](https://www.npmjs.com/package/@walkeros/server-destination-linkedin)

<!-- -->

[Package](https://www.npmjs.com/package/@walkeros/server-destination-linkedin)

Server-side event delivery to LinkedIn's Conversions API for enhanced ad attribution and privacy-compliant conversion tracking.

<!-- -->

Where this fits

LinkedIn Conversions API is a **server destination** in the walkerOS flow:

Sends conversion events server-side to LinkedIn's Conversions API, bypassing browser limitations for improved data quality. Deduplicates with the browser-side Insight Tag via \`eventId\`.

## Installation[​](#installation "Direct link to Installation")

```
npm install @walkeros/server-destination-linkedin
```

* Integrated
* Bundled

```
import { startFlow } from '@walkeros/collector';
import { destinationLinkedIn } from '@walkeros/server-destination-linkedin';

await startFlow({
  destinations: {
    linkedin: {
      code: destinationLinkedIn,
      config: {
        settings: {
          accessToken: 'YOUR_ACCESS_TOKEN',
          conversionRuleId: 'YOUR_CONVERSION_RULE_ID',
        },
      },
    },
  },
});
```

Add to your `flow.json` destinations:

```
"destinations": {
  "linkedin": {
    "package": "@walkeros/server-destination-linkedin",
    "import": "destinationLinkedIn",
    "config": {
      "settings": {
        "accessToken": "YOUR_ACCESS_TOKEN",
        "conversionRuleId": "YOUR_CONVERSION_RULE_ID"
      }
    }
  }
}
```

[See bundled mode setup](https://www.walkeros.io/docs/getting-started/modes/bundled.md) | [CLI reference](https://www.walkeros.io/docs/apps/cli.md)

## Configuration[​](#configuration "Direct link to Configuration")

This <!-- -->destination<!-- --> uses the standard <!-- -->destination<!-- --> config wrapper (consent, data, env, id, ...). For the shared fields see [destination<!-- --> configuration](https://www.walkeros.io/docs/destinations.md#configuration). Package-specific fields live under `config.settings` and are listed below.

## Settings[​](#settings "Direct link to Settings")

| Property            | Type                     | Description                                                        | More |
| ------------------- | ------------------------ | ------------------------------------------------------------------ | ---- |
| `accessToken*`      | `string`                 | LinkedIn OAuth 2.0 Bearer token for Conversions API authentication |      |
| `conversionRuleId*` | `string`                 | Default LinkedIn conversion rule ID from Campaign Manager          |      |
| `apiVersion`        | `string`                 | Linkedin-Version header value in YYYYMM format                     |      |
| `doNotHash`         | `Array<string>`          | Array of user data fields that should not be hashed                |      |
| `url`               | `string`                 | Custom URL for LinkedIn Conversions API endpoint                   |      |
| `user_data`         | `Record<string, string>` | Mapping configuration for user data fields                         |      |

\* Required fields

## Mapping[​](#mapping "Direct link to Mapping")

Per-event rules under `config.mapping`. For the standard rule fields (consent, condition, data, batch, name, policy) see [mapping](https://www.walkeros.io/docs/mapping.md).

| Property     | Type               | Description                                                    | More |
| ------------ | ------------------ | -------------------------------------------------------------- | ---- |
| `conversion` | `conversion`       | Per-event conversion override with ruleId, value, and currency |      |
| `ruleId`     | `string`           | Override conversion rule ID for this event                     |      |
| `value`      | `string \| number` | Conversion monetary value                                      |      |
| `currency`   | `string`           | ISO 4217 currency code                                         |      |

## Examples

### Lead

A form submission is posted to LinkedIn as a conversion with the SHA-256 hashed email as the user identifier.

Event

```
{
  "name": "form submit",
  "data": {
    "string": "foo",
    "number": 1,
    "boolean": true,
    "array": [
      0,
      "text",
      false
    ]
  },
  "context": {
    "dev": [
      "test",
      1
    ]
  },
  "globals": {
    "lang": "elb"
  },
  "custom": {
    "completely": "random"
  },
  "user": {
    "email": "user@example.com"
  },
  "nested": [
    {
      "entity": "child",
      "data": {
        "is": "subordinated"
      }
    }
  ],
  "consent": {
    "functional": true
  },
  "id": "ev-1700000901000",
  "trigger": "test",
  "entity": "form",
  "action": "submit",
  "timestamp": 1700000901000,
  "timing": 3.14,
  "source": {
    "count": 1,
    "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
    "type": "express",
    "platform": "server"
  }
}
```

Out

```
sendServer("https://api.linkedin.com/rest/conversionEvents", "{\"elements\":[{\"conversion\":\"urn:lla:llaPartnerConversion:12345678\",\"conversionHappenedAt\":1700000901000,\"user\":{\"userIds\":[{\"idType\":\"SHA256_EMAIL\",\"idValue\":\"b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514\"}]},\"eventId\":\"ev-1700000901000\"}]}", {
  "headers": {
    "Authorization": "Bearer s3cr3t",
    "Content-Type": "application/json",
    "X-Restli-Protocol-Version": "2.0.0",
    "X-RestLi-Method": "BATCH_CREATE",
    "Linkedin-Version": "202604"
  }
})
```

### Purchase

A completed order is sent to the LinkedIn Conversions API with conversion value, currency, and hashed email.

Event

```
{
  "name": "order complete",
  "data": {
    "total": 249.99,
    "currency": "EUR"
  },
  "context": {
    "shopping": [
      "complete",
      0
    ]
  },
  "globals": {
    "pagegroup": "shop"
  },
  "custom": {
    "completely": "random"
  },
  "user": {
    "email": "jane@example.com"
  },
  "nested": [
    {
      "entity": "product",
      "data": {
        "id": "ers",
        "name": "Everyday Ruck Snack",
        "color": "black",
        "size": "l",
        "price": 420
      },
      "context": {
        "shopping": [
          "complete",
          0
        ]
      },
      "nested": []
    },
    {
      "entity": "product",
      "data": {
        "id": "cc",
        "name": "Cool Cap",
        "size": "one size",
        "price": 42
      },
      "context": {
        "shopping": [
          "complete",
          0
        ]
      },
      "nested": []
    },
    {
      "entity": "gift",
      "data": {
        "name": "Surprise"
      },
      "context": {
        "shopping": [
          "complete",
          0
        ]
      },
      "nested": []
    }
  ],
  "consent": {
    "functional": true
  },
  "id": "ev-1700000900000",
  "trigger": "load",
  "entity": "order",
  "action": "complete",
  "timestamp": 1700000900000,
  "timing": 3.14,
  "source": {
    "count": 1,
    "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
    "type": "express",
    "platform": "server"
  }
}
```

Mapping

```
{
  "settings": {
    "conversion": {
      "map": {
        "value": "data.total",
        "currency": {
          "key": "data.currency",
          "value": "EUR"
        }
      }
    }
  }
}
```

Out

```
sendServer("https://api.linkedin.com/rest/conversionEvents", "{\"elements\":[{\"conversion\":\"urn:lla:llaPartnerConversion:12345678\",\"conversionHappenedAt\":1700000900000,\"user\":{\"userIds\":[{\"idType\":\"SHA256_EMAIL\",\"idValue\":\"8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d\"}]},\"eventId\":\"ev-1700000900000\",\"conversionValue\":{\"currencyCode\":\"EUR\",\"amount\":\"249.99\"}}]}", {
  "headers": {
    "Authorization": "Bearer s3cr3t",
    "Content-Type": "application/json",
    "X-Restli-Protocol-Version": "2.0.0",
    "X-RestLi-Method": "BATCH_CREATE",
    "Linkedin-Version": "202604"
  }
})
```

### Purchase with li\_fat\_id

A purchase is sent to LinkedIn with both the hashed email and the first-party li\_fat\_id tracking identifier.

Event

```
{
  "name": "order complete",
  "data": {
    "total": 89.99,
    "currency": "USD"
  },
  "context": {
    "li_fat_id": [
      "abc123-fat-id",
      0
    ]
  },
  "globals": {
    "pagegroup": "shop"
  },
  "custom": {
    "completely": "random"
  },
  "user": {
    "email": "buyer@co.com"
  },
  "nested": [
    {
      "entity": "product",
      "data": {
        "id": "ers",
        "name": "Everyday Ruck Snack",
        "color": "black",
        "size": "l",
        "price": 420
      },
      "context": {
        "shopping": [
          "complete",
          0
        ]
      },
      "nested": []
    },
    {
      "entity": "product",
      "data": {
        "id": "cc",
        "name": "Cool Cap",
        "size": "one size",
        "price": 42
      },
      "context": {
        "shopping": [
          "complete",
          0
        ]
      },
      "nested": []
    },
    {
      "entity": "gift",
      "data": {
        "name": "Surprise"
      },
      "context": {
        "shopping": [
          "complete",
          0
        ]
      },
      "nested": []
    }
  ],
  "consent": {
    "functional": true
  },
  "id": "ev-1700000902000",
  "trigger": "load",
  "entity": "order",
  "action": "complete",
  "timestamp": 1700000902000,
  "timing": 3.14,
  "source": {
    "count": 1,
    "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
    "type": "express",
    "platform": "server"
  }
}
```

Mapping

```
{
  "settings": {
    "conversion": {
      "map": {
        "value": "data.total",
        "currency": {
          "key": "data.currency",
          "value": "USD"
        }
      }
    }
  },
  "data": {
    "map": {
      "user_data": {
        "map": {
          "li_fat_id": "context.li_fat_id"
        }
      }
    }
  }
}
```

Out

```
sendServer("https://api.linkedin.com/rest/conversionEvents", "{\"elements\":[{\"conversion\":\"urn:lla:llaPartnerConversion:12345678\",\"conversionHappenedAt\":1700000902000,\"user\":{\"userIds\":[{\"idType\":\"SHA256_EMAIL\",\"idValue\":\"484c39bfb51212665d9673805c112b5ba04cbf0460b6d3f00bcdc18b92afed66\"},{\"idType\":\"LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID\",\"idValue\":\"abc123-fat-id\"}]},\"eventId\":\"ev-1700000902000\",\"conversionValue\":{\"currencyCode\":\"USD\",\"amount\":\"89.99\"}}]}", {
  "headers": {
    "Authorization": "Bearer s3cr3t",
    "Content-Type": "application/json",
    "X-Restli-Protocol-Version": "2.0.0",
    "X-RestLi-Method": "BATCH_CREATE",
    "Linkedin-Version": "202604"
  }
})
```

## User identification[​](#user-identification "Direct link to User identification")

The destination builds a `userIds` array from the event data. At least one identifier is required or the event is silently skipped.

**SHA256\_EMAIL**: resolved from `event.user.email` or a `user_data.email` mapping. The email is normalized (trimmed, lowercased) and SHA-256 hashed before sending. Set `doNotHash: ['email']` if you are pre-hashing upstream.

**LINKEDIN\_FIRST\_PARTY\_ADS\_TRACKING\_UUID**: the LinkedIn click ID (`li_fat_id`) forwarded from the browser session. Map it via `user_data` in settings or through event mapping:

```
"settings": {
  "accessToken": "$env.LINKEDIN_ACCESS_TOKEN",
  "conversionRuleId": "$env.LINKEDIN_CONVERSION_RULE_ID",
  "user_data": {
    "li_fat_id": "context.li_fat_id"
  }
}
```

## Per-event conversion override[​](#per-event-conversion-override "Direct link to Per-event conversion override")

The default `conversionRuleId` from settings applies to all events. Override it per event via mapping to route different events to different Campaign Manager conversion rules:

```
"mapping": {
  "order": {
    "complete": {
      "settings": {
        "conversion": {
          "map": {
            "ruleId": { "value": "99887766" },
            "value": "data.total",
            "currency": { "key": "data.currency", "value": "EUR" }
          }
        }
      }
    }
  }
}
```

## Browser deduplication[​](#browser-deduplication "Direct link to Browser deduplication")

When running both the web [LinkedIn Insight Tag](https://www.walkeros.io/docs/destinations/web/linkedin.md) and this server destination, use the same `eventId` (from `event.id`) on both sides. LinkedIn deduplicates conversions that share the same `eventId` and conversion rule, so only one conversion is counted.
