Troubleshoot implementing first-party cookies on your website

Last updated: 8 months ago

Enabling first-party cookies on your Insight Tag allows you to more accurately measure your conversions. When first-party cookies are enabled on your Insight Tag, cookies are created from your website instead of LinkedIn or a third party. 

Enabling first-party cookies adds the parameter li_fat_id to the URLs of your LinkedIn ads. In rare cases, this may cause issues with loading a page on your website if the application or web server doesn’t handle unknown parameters. 

Review the common issues that occur when implementing first-party cookies on your website and steps to take to resolve them.

Page not found error

If your page doesn’t display when the URL is clicked, you may need to confirm how your web server checks parameters. 

  • If your web server expects a known set of parameters, add li_fat_id as a parameter.

  • If your web server evaluates query parameters to locate a resource, the server should skip evaluating li_fat_id. Configure your server settings to allow li_fat_id.

URL missing the li_fat_id parameter

If your page URL is missing the li_fat_id parameter when the first-party cookie setting is enabled, you may need to check if a client JavaScript is cleaning the URL, or if there is a delayed application state in which the li_fat_id parameter is added back later. This is common in Single Page Applications. 

Client application clears the URL

An application may be configured to read query parameters to determine states in a single-page or multi-page experience. It can clean its own URL to correctly represent the state it's in. 

  • The client application framework should add li_fat_id as an exception and/or skip taking any action on it. Make sure the parameter persists in the URL until the Insight Tag has made a call. 

  • If the client application clears and cleans unknown values from the address bar, make sure the Insight Tag call occurs as early as possible, preferably before loading any library. To help the Insight Tag call occur quickly, place the Insight Tag as high in the website header as possible.

Delayed application state

If you’re experiencing a delayed application state, you may need to make sure the Insight Tag call occurs as late as possible after all resources have loaded and the page URL fully represents the conversion URL (including the li_fat_id parameter). 

Using a container tag or a tag manager

If you’re using Doubleclick or Google Tag Manager, the li_fat_id parameter may be dropped from the final generated call. Make sure to add li_fat_id into the configuration for the tag manager so that the parameter persists in the generated URL that is called. For example:

Parameter configuration

For intermediate redirects to a third-party site, keep in mind the li_fat_id parameter is only needed by LinkedIn. Make sure that this redirect sends the original page URL including the li_fat_id parameter, the same as the above example. 

Related tasks

Learn more