Blog Post

Web Analytics

Halid

Osmaev

published on:

12.04.2024

Why LinkedIn CAPI Tracking Doesn't Work

Table of Contents

No table of contents available
No table of contents available
No table of contents available

LinkedIn CAPI is a new interface to send conversions via Server Side Tracking. Additional user data can also be transmitted to more accurately track the attribution to the respective LinkedIn campaigns.

What is LinkedIn CAPI about?

The term CAPI is already known to some from the (Meta CAPI Tag)[https://developers.facebook.com/docs/marketing-api/conversions-api/guides/gtm-server-side/]. The Meta CAPI Tag is a great help in significantly improving the tracking and optimization of Meta campaigns.

Finally, an official LinkedIn CAPI Tag has also been added as a Tag Template to the Google Tag Manager. This can be found and added through the community templates. There are several guides on how to implement the tag, but it has become evident during implementation that it does not work as initially thought.

The Problem

Many guides currently available on the internet do not lead to functional tracking. Despite the configuration as per various instructions, no conversions are received in the LinkedIn Campaign Manager.

The reason for this is some parameters that are required but not marked as such. To correctly implement LinkedIn CAPI Tracking, follow the instructions below:

The (correct) Instructions

Prerequisites
To track LinkedIn CAPI conversions, the following prerequisites must be met:

  • There must be a functioning Server Side Tracking in place 

  • LinkedIn campaigns must already be set up

1. Generate API Access Token
The first step is to generate and then extract the LinkedIn API Access Token.

  1. Log in to LinkedIn Campaign Manager.

  2. Click on Analyze in the left menu under Conversion Tracking.

  3. Click on Data Sources.

  4. In the Create source dropdown, click on Conversion API or CSV.

  5. Select the Google Tag Manager option and follow the steps.

  6. Securely save the generated API Token

2. Create a LinkedIn Conversion
You will also need the LinkedIn Conversion to be tracked and its Conversion Rule ID.

  1. In the Create Conversion dropdown, click on Conversions API or CSV conversion.

  2. Select the Google Tag Manager option and follow the steps.

  3. After successful creation, reopen the conversion from the conversion overview.

  4. The Conversion Rule ID can be extracted from the URL

3. Configure Client
Now that the necessary information is available, configuration of the client-side Google Tag Manager can begin.

  1. Create a new First-Party-Cookie Variable that reads the cookie “li_fat_id”.

  2. Open the Google tag and add the Parameter: user_data.linkedinFirstPartyId with the value of the mentioned Variable.

  3. Additionally, add a randomly generated number as the parameter EventID. This can be used to deduplicate events when using client-side LinkedIn Insight Tags and CAPI Tags.

  4. If not already present, create a GA4 event for the created conversion

4. Configure Server
Afterwards, the server-side Google Tag Manager must be configured

  1. Add the LinkedIn | CAPI Tag Template from linkedin-developers from the community gallery.

  2. Fill the parameters LinkedIn API Access Token and Conversion Rule ID with the values from steps 1 and 2.

  3. Provide the sent Event ID under EventID.

  4. Enter the value {"currencyCode": "EUR", "amount": "0.0"} as the Conversion Value. Here “EUR” and “0.0” can be adjusted if the conversion provides a corresponding value (e.g., a product purchase). If not, do not change the value.
    Finally, the tag configuration should look like this

Notes
The reason why tracking did not work for many instructions is that parameters like Conversion Value, which were marked as optional, were not optional. Furthermore, the parameter user_data.linkedinFirstPartyId was required, otherwise attribution to the LinkedIn campaigns would not be possible.

Further Configuration Options

It is possible to expand LinkedIn CAPI Tracking. The following parameters can optionally be sent from the client-side Google Tag to be automatically captured and transmitted by the LinkedIn CAPI Tag

  • user_data.sha256_email_address: The hashed email address of the user

  • user_data.companyName: The company name of the user

  • user_data.jobTitle: The job title of the user

  • user_data.address.first_name: The first name of the user

  • user_data.address.last_name: The last name of the user

Attribution to campaigns through the last 4 parameters is not always guaranteed. It can certainly happen that multiple users with given data are found if only the first name is sent.

Furthermore, it should be noted that any user data should only be transmitted if the users have given consent!

Our competent web analytics team is happy to help you set up the tracking or answer any other questions. Our web analytics experts are here to provide advice and assistance. Please contact us

Halid

Osmaev

Halid Osmaev has been with the internetwarriors in web analytics since August 2021. With extensive knowledge in IT and mathematics, he can assist you with everything from simple to the most complex web analytics topics. Whether it's setting up a basic tracking infrastructure or conducting an in-depth analysis of company processes, he's ready to help.

no comments yet

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Newsletter

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Newsletter

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Newsletter