Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 70 additions & 20 deletions components/data-collection/linkedin-capi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,65 @@ Here's how Edgee events map to LinkedIn CAPI events:

When you make a `user` call, Edgee stores the user's data (user_id, anonymous_id, and properties) on the device. This enables proper attribution for subsequent page views and events.

## Native Cookie Support for LinkedIn Attribution

Edgee automatically manages LinkedIn's first-party attribution cookie (`_li_fat_id`) at the edge level, ensuring proper tracking across page views and domain boundaries.

### How it Works

Edgee uses **last-touch attribution** for LinkedIn's `li_fat_id` parameter:

1. **First LinkedIn ad click**: Captures `li_fat_id` from URL and sets the `_li_fat_id` cookie (90-day expiry)
2. **Subsequent ad clicks**: Cookie automatically **updates** with the new `li_fat_id` from the URL
3. **Regular page views** (no URL parameter): Cookie value persists and is used for attribution
4. **Return visits**: Attribution maintained for 90 days from the last update

This **last-touch** approach credits the most recent LinkedIn ad that brought the user to your site, which is ideal for remarketing campaigns and conversion optimization.

### Cookie Format

- **Name**: `_li_fat_id`
- **Value**: Raw `li_fat_id` value from LinkedIn (stored as-is)
- **Expiry**: 90 days
- **Purpose**: LinkedIn first-party ad tracking attribution

### Consent Management

The `mode` setting controls cookie behavior based on user consent:

- **`safe`** (default): Only sets the cookie when explicit consent is granted
- **`strong`**: Sets the cookie unless consent is explicitly denied
- **`always`**: Always sets the cookie (bypasses consent management)

Configure the mode in your component settings:

```json
{
"components": {
"edgee/linkedin-capi": {
"mode": "strong"
}
}
}
```

### Benefits

- **No JavaScript required**: Cookie management happens at the edge, before the page loads
- **Works with ad blockers**: Server-side tracking ensures attribution isn't blocked
- **Cross-domain support**: Perfect for scenarios like Shopify checkout flows
- **Automatic persistence**: Users don't need the `li_fat_id` parameter on every page


## Getting Started

**To integrate LinkedIn CAPI into your Edgee project:**

1. Open the Edgee console and navigate to your project's Components.
2. Select "Add a component" and choose `edgee/linkedin-capi` from the list of available components.
3. Enter the following credentials:
3. Enter the following settings:
- `LinkedIn Access Token`: Your LinkedIn CAPI access token
- `Native Cookies Mode`: Choose your consent mode (`safe`, `strong`, or `always`)
4. Click Save to complete the setup.

To know how to get your access token , visit the [LinkedIn Marketing API documentation](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/conversions-api).
Expand All @@ -66,37 +116,37 @@ When configuring the component in your **Edgee Data Layer** or within SDK calls,
3. Send a test event through Edgee
4. Verify that the event is received by LinkedIn

For more details on LinkedIn Conversions API implementation, refer to the
For more details on LinkedIn Conversions API implementation, refer to the
[official LinkedIn CAPI documentation](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/conversions-api).


## Step by Step Set up Guide For LinkedIn CAPI

Implementing the LinkedIn Conversion API via Edgee is simple and straightforward. The next sections will guide you on:

1. How to create a conversion pixel on LinkedIn
2. How to get your access token and set up LinkedIn Conversion in Edgee
1. How to create a conversion pixel on LinkedIn
2. How to get your access token and set up LinkedIn Conversion in Edgee
3. An implementation example

### Creating a LinkedIn Conversion API Pixel in a Nutshell

* Go to your LinkedIn Advertising account, then navigate to **Data \-\> Signal Manager** and select **Direct API**.
* Click on **Direct API** and then on **Create Conversion**.
* Fill in your Conversion tracking goal.
* Select the correct category for the conversion.
* Go to your LinkedIn Advertising account, then navigate to **Data \-\> Signal Manager** and select **Direct API**.
* Click on **Direct API** and then on **Create Conversion**.
* Fill in your Conversion tracking goal.
* Select the correct category for the conversion.
* In the review section, associate the CAPI conversion with your campaign.

### LinkedIn Access Token and Setup in Edgee

1. Go to your LinkedIn Advertising account, then navigate to **Data \-\> Signal Manager** and select **Direct API**.
1. Go to your LinkedIn Advertising account, then navigate to **Data \-\> Signal Manager** and select **Direct API**.

<img src="/images/LinkedIn/linkedSignalManager.png" />


2. Scroll down to the "**Direct API access token**" section. Follow LinkedIn's steps and copy your LinkedIn Access Token. This Access Token is consistent for all future LinkedIn CAPI implementations.
2. Scroll down to the "**Direct API access token**" section. Follow LinkedIn's steps and copy your LinkedIn Access Token. This Access Token is consistent for all future LinkedIn CAPI implementations.
<img src="/images/LinkedIn/linkedInAPIaccess.png" />

3. Go to your Edgee account and project, then navigate to **Components** (learn to set up components [here](https://www.edgee.cloud/docs/getting-started/component-configuration)). Select LinkedIn and input your token.
3. Go to your Edgee account and project, then navigate to **Components** (learn to set up components [here](https://www.edgee.cloud/docs/getting-started/component-configuration)). Select LinkedIn and input your token.
<img src="/images/LinkedIn/linkedin_api_edgee.png" />


Expand All @@ -114,8 +164,8 @@ You will find your conversion pixel that can be used for CAPI, and an associated
<img src="/images/LinkedIn/conversion_pixelD.png" />


2. Once you have the ID, you can use the conversion to track in two different ways using our SDK:
a. Track the conversion of a user when you have their email address (e.g., from a form submission).
2. Once you have the ID, you can use the conversion to track in two different ways using our SDK:
a. Track the conversion of a user when you have their email address (e.g., from a form submission).
b. Track standard landing page conversions without having the user's email.

### Example: Tracking a form submission where you have an email address:
Expand All @@ -134,17 +184,17 @@ edgee.track({ name: "urn:lla:llaPartnerConversion:[YOUR_CONVERSION_PIXEL_ID]"});
```

<Note>Note: replace `[YOUR_CONVERSION_PIXEL_ID]` with your LinkedIn CAPI ID.</Note>



```
<script>
const trackLinkedInFormSubmission = () => {
const trackLinkedInFormSubmission = () => {
edgee.user({ "properties": { "email": "me@example.com"} });
edgee.track({name:"urn:lla:llaPartnerConversion:[YOUR_CONVERSION_PIXEL_ID]"} );};
edgee.track({name:"urn:lla:llaPartnerConversion:[YOUR_CONVERSION_PIXEL_ID]"} );};
if (!window.edgee) {
window.addEventListener('edgee:loaded', trackLinkedInFormSubmission);
} else {
} else {
trackLinkedFormSubmission();
}
</script>
Expand Down Expand Up @@ -179,12 +229,12 @@ The implementation of these events, such as Landing Page, is very straightforwar

If you have InsightTag and want your LinkedIn CAPI to work alongside InsightTag, `event_id` can be used to deduplicate conversions.

1. Create a JavaScript that will generate a unique number for every new event.
1. Create a JavaScript that will generate a unique number for every new event.
2. Update the Edgee track SDK to collect `event_id` by adding it to the properties (shown below) and ensure the ID is also provided to your InsightTag.

```javascript
edgee.track( {
name: "urn:lla:llaPartnerConversion:[YOUR_CONVERSION_PIXEL_ID]",
name: "urn:lla:llaPartnerConversion:[YOUR_CONVERSION_PIXEL_ID]",
properties: {event_id: "1234543"}
});
```
Expand Down