This guide explains how to configure the LinkedIn Conversion API (CAPI) using a server-side Google Tag Manager container provisioned by Seers.
Prerequisites
Before starting the implementation, make sure the following are ready:
- LinkedIn Campaign Manager: You will need Account Manager, Campaign Manager, Creative Manager, or Account Billing Admin access to at least one LinkedIn Campaign Manager Ads account.
- Conversion Rule ID and Access Token: Both are required for the LinkedIn Conversion API and can be retrieved from LinkedIn Campaign Manager.
- Server-Side GTM Container (Seers): A server-side GTM container provisioned by Seers, accessible via a first-party endpoint, and configured to process GA4 events. Visit the Seers Get Started guide for setup instructions, and refer to Google's support documentation for guidance on sharing GTM container access.
Why Use Server-Side Tagging with LinkedIn CAPI?
Improved Website Performance
By shifting tracking tags from the browser to the server, you reduce the number of JavaScript snippets that need to load on each page. This helps keep your site fast and avoids the performance overhead that comes with client-side tagging at scale.
Resilience to Cookie Deprecation
This approach is unaffected by the deprecation of third-party cookies in browsers such as Google Chrome. Server-side conversion tracking does not rely on third-party cookies, making it a more future-proof solution for long-term attribution.
Enhanced Data Control and Security
Server-side tagging puts you in complete control of what data is shared with each destination, including LinkedIn. You can centralise tag management and determine precisely which information is transmitted, reducing unnecessary data exposure.
Increased Efficiency and Deployment Speed
This method simplifies the process of deploying and updating marketing and analytics tags. Changes can be made server-side without requiring code updates to your website, reducing dependency on development resources and speeding up campaign operations.
Implementation Overview
The setup involves three main steps:
- Step 1: Create a Conversion Rule and Access Token in LinkedIn Campaign Manager. Note the Conversion Rule ID.
- Step 2: Install and configure the LinkedIn CAPI tag template in your server-side GTM container using the Access Token and Conversion Rule ID, then publish the container.
- Step 3: With Preview mode active in both your web and server GTM containers, perform a test conversion and confirm an HTTP 201 response. Verify the conversion rule shows as Active in LinkedIn Campaign Manager.
Step 1: Retrieve Your LinkedIn API Credentials
Begin by collecting the required identifiers from LinkedIn Campaign Manager: the API Access Token for authentication, the Conversion Rule ID for event mapping, and optionally the Unique Event ID for deduplication if you are also running the LinkedIn Insight Tag client-side.
LinkedIn API Access Token
Generate your access token in LinkedIn Campaign Manager by navigating to Measurement > Insights > Manage Sources > Google Tag Manager.
Conversion Rule ID
For specific conversion events such as a purchase, you will need the ID of the relevant conversion rule. Create or locate the rule in Campaign Manager under Measurement > Conversion Tracking. The Conversion Rule ID is typically visible in the page URL when viewing the rule's details.
Unique Event ID for Deduplication (Optional)
If you are running the LinkedIn Insight Tag client-side alongside server-side tracking, you should send a matching unique event ID from both sources. This allows LinkedIn to deduplicate the conversion and ensure it is only counted once.
- In your web GTM container, go to Variables and click New.
- Select Custom JavaScript Variable and paste in the following code:
function() {
var timestamp = new Date().getTime();
var randomNumber = Math.random().toString(36).substring(2);
return 'evt_' + timestamp + '_' + randomNumber;
} |
- Name this variable CJS - Unique Event ID.
Add the Event ID to Your GA4 Event Tags
On each GA4 event tag in your web container, add a parameter named event_id and set its value to the {{CJS - Unique Event ID}} variable.
Set Up the LinkedIn InsightTag 2.0 (If Using Client-Side Tracking)
- In your Web GTM container, go to Tags and click New.
- Click Tag Configuration and search for the LinkedIn InsightTag 2.0 template in the Community Template Gallery.
- Enter your Partner ID / Insight Tag ID and your Conversion Rule ID. It is best practice to store these values in Constant variables.
- Insert the {{CJS - Unique Event ID}} variable in the Event ID field.
- Set the trigger to All Pages.
Step 2: Configure the Server-Side GTM Container
This step covers installing and configuring the LinkedIn CAPI tag in your Seers server-side GTM container, which will receive data from your website and forward it to LinkedIn.
Install and Configure the LinkedIn CAPI Tag
- In your server-side GTM container, open the Community Template Gallery and search for the LinkedIn | CAPI Tag Template. Install it in your workspace.
- Go to Tags and click New. Select the LinkedIn CAPI tag template you just installed.
- Configure the tag using the credentials you gathered in Step 1:
- API Access Token: Paste the access token generated from LinkedIn Campaign Manager. Store it securely as a variable in your server-side GTM container.
- Conversion Rule ID: Enter the Conversion Rule ID for the event you want to track.
- Optionally, add a Unique Event ID or a Conversion Value by mapping the relevant variables to the corresponding fields in the tag configuration.
- Optionally, override User IDs, User ID Info, or Event Data by specifying Property Name and Property Value pairs in the respective dropdown menus.
Publish the Server Container
Once the tag is fully configured and reviewed, publish the changes in your server-side GTM container. This activates the LinkedIn CAPI tag and makes it ready to process incoming data.
Step 3: End-to-End Verification and Testing
This final step confirms that data is flowing correctly from your website, through the Seers server-side GTM container, and into LinkedIn's platform.
Activate Preview Mode and Run a Test
- Enable Preview mode in your server-side GTM container.
- Open your website and perform a test conversion, for example, submit a form that is configured to trigger the LinkedIn CAPI tag.
- In the server-side GTM Tag Assistant, verify that the LinkedIn CAPI tag fires successfully.
- Confirm that the server received a 201 response code from the LinkedIn API. A 201 status indicates that the conversion was successfully accepted by LinkedIn.
Confirm the Conversion Rule Status in LinkedIn Campaign Manager
Return to LinkedIn Campaign Manager and check the status of your CAPI conversion rule. If the end-to-end data flow is working correctly, the rule status will have changed to Active, confirming that LinkedIn is successfully receiving and processing your server-side conversion events.