Overview

This guide explains how to implement LinkedIn Conversions API (CAPI) using Google Tag Manager (GTM) and server-side GTM through Hardal’s server-side infrastructure. This implementation provides more reliable conversion tracking by sending data directly from your server to LinkedIn.

Prerequisites

Before beginning this implementation, ensure you have:

  • A Hardal account
  • A server-side GTM container
  • A web GTM container installed on your website
  • A LinkedIn Campaign Manager account with admin access
  • Google Analytics 4 (GA4) implemented on your website

Implementation Steps

1

Deploy a Server Container in GTM

First, you need to set up a server-side GTM container in Hardal.

If you’ve already set up server-side GTM in Hardal, you can skip this step and use your existing setup.

2

Configure GA4 Client in Server Container

In your server-side GTM container:

  1. Go to “Clients” and ensure the built-in “GA4” client is configured
  2. Set the following parameters:
    • Priority: 0 (default)
    • Default GA4 paths: Enabled
    • Default gtag.js paths: Enabled with your GA4 Measurement ID(s)
    • Automatically serve dependent scripts: Enabled
    • Compress HTTP response: Enabled
    • Enable region-specific settings: Enabled with Visitor Region variable
    • Cookies and Client Identification: Server Managed

The GA4 client is essential as it will parse incoming GA4 requests from your website and make the data available to your LinkedIn CAPI tag.

3

Add LinkedIn CAPI Tag to Server Container

  1. In your server-side GTM container, go to “Tags” and click “New”
  2. Click “Discover more tag types in the Community Template Gallery”
  3. Search for “LinkedIn | CAPI Tag Template” from linkedin-developers

  1. Click “Add to Workspace”

  1. Add all information required by the tag

4

Create Trigger for LinkedIn CAPI Tag

  1. While still in the tag configuration, click “Triggering”
  2. Create a new trigger:
    • Trigger Type: Custom Event
    • Event Name: any of your desired conversion events (e.g., “purchase”, “lead”, “sign_up”)
    • This trigger fires on: Some Custom Events
    • Add a condition: “Event Name equals [your conversion event]”
  3. Save your trigger

To track multiple conversion types, you can either:

  • Create separate LinkedIn CAPI tags with different triggers for each conversion type
  • Use a single tag with multiple triggers
  • Use a single tag with a more general trigger and handle event mapping in the tag code
5

Configure LinkedIn Campaign Manager

  1. In LinkedIn Campaign Manager, go to Account Assets > Conversions
  2. Click “Create a conversion”
  3. Select “Conversions API” as your source
  4. Name your conversion and select the appropriate category
  5. In the integration step, select “Google Tag Manager”
  6. Connect your GTM account if prompted
  7. Fill in your integration details:
    • GA4 measurement ID
    • Tagging server URL (your Hardal sGTM endpoint)
    • Web GA4 event trigger name
  8. Complete the setup by associating campaigns with your conversion
6

Test the Implementation

  1. Enable Preview mode in both your web and server GTM containers
  2. Visit your website and trigger a conversion action
  3. In the web container preview, verify:
    • The GA4 event tag fires correctly
    • Data is sent to the server container
  4. In the server container preview, verify:
    • The event data is received by the GA4 client
    • The LinkedIn CAPI tag fires
    • The request to LinkedIn’s API is successful
  5. In LinkedIn Campaign Manager, use the Test Events tool to verify conversion reception

Event Data Mapping

When sending events from GA4 to LinkedIn CAPI via Hardal’s server-side GTM, use the following event name mapping:

GA4 Event NameLinkedIn Conversion Type
purchasePurchase
generate_leadLead
sign_upSign Up
submit_applicationApply
request_demoRequest Demo
downloadDownload
add_to_cartAdd to Cart

Ensure that your GA4 events include these parameters for successful LinkedIn tracking:

  • Required: event_name (conversion type)
  • Required for user matching: email address (hashed)
  • Recommended: value, currency (for purchase events)
  • Optional: product details, user data, etc.

Advanced Configuration

Implementing Enhanced Match with Multiple Identifiers

To improve match rates, enhance your LinkedIn CAPI tag with multiple user identifiers:

  1. LinkedIn Cookie: Add code to capture and send LinkedIn’s first-party cookie
  2. LinkedIn Click ID: Capture and forward LinkedIn click IDs from ad URLs
  3. External ID: Include your CRM or user IDs for better cross-channel tracking

Adding Enhanced Conversion Data

For richer conversion information, especially for purchase events, include:

  1. Transaction ID: Add a unique identifier for each conversion
  2. Product Details: Include product IDs, categories, and quantities
  3. Customer Value: Add information about customer lifetime value

Troubleshooting