LinkedIn Conversions API
Datafly Signal delivers conversion events to LinkedIn server-to-server using the LinkedIn Marketing API Conversions endpoint. This enables accurate B2B conversion tracking for LinkedIn ad campaigns without depending on the LinkedIn Insight Tag client-side script.
Prerequisites
Before configuring LinkedIn Conversions API in Signal, you need a LinkedIn Campaign Manager account, a conversion rule, and an OAuth access token. Follow the steps below to set everything up.
Step 1: Create a LinkedIn Campaign Manager Account
If you don’t already have one:
- Go to business.linkedin.com and sign in with your LinkedIn account.
- Click Create a free account in Campaign Manager.
- Enter your account name, currency, and associate it with a LinkedIn Page.
- Complete the setup wizard. Note your Ad Account ID (numeric) from the account settings page.
Step 2: Create a Conversion Rule
Conversion rules define the actions you want to track (e.g. purchases, leads, sign-ups). Each rule gets a unique ID that you will map to Datafly events.
- In Campaign Manager, go to Analyze > Conversion Tracking.
- Click Create Conversion.
- Choose a conversion type (e.g. Lead, Purchase, Sign-up, Key Page View).
- Select Online Conversion and choose Conversions API as the tracking method.
- Configure the attribution window (default: 30-day click-through, 7-day view-through).
- Click Create. Note the conversion rule URN (e.g.
urn:lla:llaPartnerConversion:987654). - Repeat for each conversion action you want to track.
Each conversion action (purchase, lead, sign-up) requires its own conversion rule. You will map each Datafly event to a specific conversion rule ID in the integration configuration.
Step 3: Register an Application in LinkedIn Developer Portal
An application is required to obtain OAuth credentials for API access.
- Go to developer.linkedin.com and sign in.
- Click Create App.
- Fill in the application name (e.g. “Datafly Signal”), select your LinkedIn Page, and upload a logo.
- Accept the terms and click Create App.
- On the app’s Auth tab, note the Client ID and Client Secret.
- Under OAuth 2.0 settings, add your redirect URL (used during the OAuth flow).
- On the Products tab, request access to Marketing API (if not already available).
Marketing API access may require approval from LinkedIn. This can take 1-3 business days. Apply early to avoid delays.
Step 4: Generate an Access Token
Generate an OAuth 2.0 access token with the required scopes for the Conversions API.
- Initiate an OAuth 2.0 authorization flow with the following scopes:
r_ads— read access to ad accountsrw_conversions— read/write access to conversion events
- Direct the user to:
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=r_ads%20rw_conversions - Exchange the authorization code for an access token:
curl -X POST https://www.linkedin.com/oauth/v2/accessToken \ -d "grant_type=authorization_code&code=AUTH_CODE&redirect_uri=YOUR_REDIRECT_URI&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" - Note the
access_tokenandrefresh_tokenfrom the response.
LinkedIn access tokens expire after 60 days. Store the refresh token to enable automatic token renewal. If you do not provide a refresh token, you must manually update the access token before it expires.
Configure in Signal
Now that you have your Ad Account ID, conversion rule URNs, and access token, configure the integration in Signal.
Configuration Fields
| Field | Required | Description |
|---|---|---|
account_id | Yes | Your LinkedIn Ad Account ID (numeric). Found in LinkedIn Campaign Manager under Account Settings. |
access_token | Yes | OAuth 2.0 access token with r_ads and rw_conversions scopes. |
conversion_rule_id | Yes | Map of Datafly event names to LinkedIn conversion rule URNs. Each conversion action requires a separate rule ID. |
refresh_token | No | OAuth refresh token for automatic token renewal. Strongly recommended for production. |
oauth_client_id | No | Your LinkedIn app Client ID. Required if using refresh token. |
oauth_client_secret | No | Your LinkedIn app Client Secret. Required if using refresh token. |
Management UI Setup
- Go to Integrations > Add Integration > LinkedIn Conversions API.
- Enter your
account_id. - Complete the OAuth flow by clicking Connect LinkedIn Account or manually enter the
access_token. - Map your conversion events to LinkedIn conversion rule IDs (e.g.
Order Completed->urn:lla:llaPartnerConversion:987654). - Select consent categories (typically
advertising). - Click Save.
Management API Setup
curl -X POST http://localhost:8084/v1/admin/integrations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source_id": "src_abc123",
"vendor": "linkedin",
"name": "LinkedIn Conversions",
"enabled": true,
"config": {
"account_id": "123456789",
"access_token": "your_oauth_access_token",
"refresh_token": "your_refresh_token",
"oauth_client_id": "your_client_id",
"oauth_client_secret": "your_client_secret",
"conversion_rule_id": {
"Order Completed": "urn:lla:llaPartnerConversion:987654",
"Lead Generated": "urn:lla:llaPartnerConversion:987655",
"Signed Up": "urn:lla:llaPartnerConversion:987656"
}
},
"consent_categories": ["advertising"]
}'API Endpoint
POST https://api.linkedin.com/rest/conversionEventsAuthentication is via OAuth 2.0 Bearer token. Events are sent as JSON with the LinkedIn Versioned API headers.
Identity Signals
LinkedIn Click ID (li_fat_id)
The primary identity signal for LinkedIn conversions is the li_fat_id (LinkedIn First-Party Ad Tracking ID). When a user clicks a LinkedIn ad, this parameter is appended to the landing page URL:
https://example.com/landing?li_fat_id=abc123-def456-ghi789Datafly.js automatically captures the li_fat_id from the URL and persists it as a first-party cookie for the duration of the attribution window. It is included in all subsequent events sent to LinkedIn.
| Signal | Field | Description |
|---|---|---|
li_fat_id | user.userIds[].idType: LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID | LinkedIn first-party ad tracking cookie. Captured automatically from the URL parameter. |
ip_address | Forwarded from original request | Visitor’s IP address. |
user_agent | Forwarded from original request | Visitor’s User-Agent string. |
LinkedIn conversion attribution relies heavily on li_fat_id. If this parameter is not captured, LinkedIn may not be able to attribute the conversion to an ad click. Ensure your LinkedIn ad campaigns include first-party tracking.
User-Provided Signals (Hashed)
When user data is available via _df.identify(), the following fields are SHA-256 hashed before sending to LinkedIn:
| Signal | Hashing | Description |
|---|---|---|
email | SHA-256, lowercase, trimmed | User’s email address |
firstName | Sent as-is in userInfo | User’s first name |
lastName | Sent as-is in userInfo | User’s last name |
companyName | Sent as-is in userInfo | User’s company name |
All PII hashing is performed server-side by the Delivery Worker. Raw PII never leaves your infrastructure. Hashed email is sent as a supplementary signal and can improve match rates for users who are logged into LinkedIn.
Event Mapping
LinkedIn uses conversion rules rather than standard event names. Each conversion rule is created in LinkedIn Campaign Manager and assigned a unique URN. You map Datafly event names to conversion rule IDs in the integration configuration.
| Datafly Event | LinkedIn Conversion | Notes |
|---|---|---|
Order Completed / Product Purchased | Mapped via conversion_rule_id | Typically a “Purchase” conversion rule. Includes conversionValue. |
Lead Generated | Mapped via conversion_rule_id | Typically a “Lead” conversion rule |
Signed Up | Mapped via conversion_rule_id | Typically a “Sign-up” conversion rule |
page (page view) | Mapped via conversion_rule_id | Typically a “Key Page View” conversion rule |
| Custom events | Mapped via conversion_rule_id | Any Datafly event can be mapped to any conversion rule |
Events not mapped to a conversion rule ID are silently dropped for this integration.
Example: Lead Conversion Event
Datafly.js call:
_df.track("Lead Generated", {
lead_source: "contact_form",
value: 500.00,
currency: "USD"
});LinkedIn Conversions API payload sent by Signal:
{
"conversion": "urn:lla:llaPartnerConversion:987655",
"conversionHappenedAt": 1706540000000,
"conversionValue": {
"currencyCode": "USD",
"amount": "500.00"
},
"user": {
"userIds": [
{
"idType": "SHA256_EMAIL",
"idValue": "836f82db99121b3481011f16b49dfa5fbc714a0d1b1b9f784a1ebbbf5b39577f"
},
{
"idType": "LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID",
"idValue": "abc123-def456-ghi789"
}
],
"userInfo": {
"firstName": "John",
"lastName": "Doe",
"companyName": "Acme Inc"
}
},
"eventId": "evt_abc123def456"
}Testing Your Integration
Step 1: Verify Conversion Rules
- In LinkedIn Campaign Manager, go to Analyze > Conversion Tracking.
- Confirm each conversion rule is set to Conversions API tracking method.
- Note the URN for each rule and verify it matches your Signal configuration.
Step 2: Send Test Events
- Trigger events on your website with the Signal integration enabled.
- Check the Signal event debugger to confirm events are being delivered.
- Verify the delivery status shows
200 OKresponses from LinkedIn.
Step 3: Verify in Campaign Manager
- In Campaign Manager, go to Analyze > Conversion Tracking.
- Click on each conversion rule. Under Recent Activity, you should see conversion events arriving.
- Allow up to 15 minutes for conversions to appear in reporting.
LinkedIn may take up to 15 minutes to reflect conversion events in the Campaign Manager dashboard. If events are not appearing after 30 minutes, check the troubleshooting section below.
Troubleshooting
| Problem | Solution |
|---|---|
| Events not appearing in Campaign Manager | Verify the account_id and conversion rule URNs are correct. Check the access token has r_ads and rw_conversions scopes. |
401 Unauthorized errors | The access token has expired (60-day lifetime) or been revoked. Generate a new token or configure a refresh token. |
403 Forbidden errors | The app does not have Marketing API access, or the system user lacks permissions on the ad account. |
| Low attribution / no conversions matched | Ensure li_fat_id is being captured. Check that LinkedIn ad campaigns have first-party tracking enabled. Add hashed email via _df.identify() for supplementary matching. |
429 Too Many Requests | Reduce rate_limit_rps or contact LinkedIn to request a higher rate limit for your application. |
| Conversion values not appearing | Ensure value and currency are included in the event properties. LinkedIn requires both fields for revenue tracking. |
Rate Limits
| Setting | Default |
|---|---|
rate_limit_rps | 30 |
rate_limit_burst | 60 |
LinkedIn’s Marketing API has relatively strict rate limits compared to other advertising platforms. The defaults are set conservatively to avoid 429 responses.
LinkedIn applies rate limits at the application level, not per ad account. If you have multiple LinkedIn integrations across different ad accounts, they share the same rate limit pool.
For full API documentation, see LinkedIn Conversions API documentation.