Blog Post
Web Analytics
Halid
Osmaev
published on:
12.04.2024
Why LinkedIn CAPI Tracking Doesn't Work
Table of Contents
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.
Log in to LinkedIn Campaign Manager.
Click on Analyze in the left menu under Conversion Tracking.
Click on Data Sources.
In the Create source dropdown, click on Conversion API or CSV.
Select the Google Tag Manager option and follow the steps.
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.
In the Create Conversion dropdown, click on Conversions API or CSV conversion.
Select the Google Tag Manager option and follow the steps.
After successful creation, reopen the conversion from the conversion overview.
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.
Create a new First-Party-Cookie Variable that reads the cookie “li_fat_id”.
Open the Google tag and add the Parameter: user_data.linkedinFirstPartyId with the value of the mentioned Variable.
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.
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
Add the LinkedIn | CAPI Tag Template from linkedin-developers from the community gallery.
Fill the parameters LinkedIn API Access Token and Conversion Rule ID with the values from steps 1 and 2.
Provide the sent Event ID under EventID.
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