GDPRChecker

Home / Knowledge Base / LinkedIn Insight Tag Next.js Cookie Consent: Setup, Blocking, and Testing Guide

Website Compliance

LinkedIn Insight Tag Next.js Cookie Consent: Setup, Blocking, and Testing Guide

A practical guide for Next.js developers on implementing GDPR-compliant cookie consent for the LinkedIn Insight Tag. Covers step-by-step setup, common mistakes, and verification with GDPRChecker.

Run a free GDPR compliance scanPreview the findings before choosing a CMP.

Author

GDPRChecker Editorial Team

Reviewed by

Privacy & Compliance Research Team

Last updated

July 2026

Reading time

9 min read

Educational guidance for compliance readiness — not legal advice. Requirements vary by jurisdiction and your specific processing activities.

Introduction

Updated for 2026 compliance practices.

Website owners using Next.js often integrate the LinkedIn Insight Tag to track conversions and retarget audiences. However, under GDPR and ePrivacy regulations, you must obtain valid consent before setting non-essential cookies or making network requests that process personal data. This guide explains what LinkedIn Insight Tag Next.js cookie consent means, how to implement it correctly, and how to verify compliance using GDPRChecker’s scanning tools. We focus on practical steps, common pitfalls, and verification techniques—not legal advice.

LinkedIn Insight Tag Next.js cookie consent is a practical compliance topic for website owners validating consent, tags, and disclosures. The tag drops a first-party cookie (li_fat_id) and makes requests to LinkedIn domains. Without proper consent management, these actions can lead to non-compliance. This guide helps you close the consent gap by integrating a Consent Management Platform (CMP) with your Next.js app, blocking the tag until consent is given, and testing the setup thoroughly.

Requirements and Compliance Expectations

Regulatory guidance from the European Data Protection Board (EDPB) and national authorities emphasizes that tracking scripts like the LinkedIn Insight Tag require consent. Here are the key requirements:

  1. Prior Consent: No Insight Tag network requests or cookies before the user clicks “Accept.” This includes the li_fat_id cookie and any requests to px.ads.linkedin.com.
  2. Granular Choice: Users must be able to accept or reject marketing cookies separately from other categories.
  3. Transparency: Your privacy policy must disclose the use of LinkedIn Insight Tag, the data collected, and how it’s shared with LinkedIn.
  4. Easy Withdrawal: Users must be able to change their consent as easily as they gave it.
  5. Documentation: You must keep records of consent (when, how, and what the user agreed to).

For Next.js sites, these requirements translate into technical controls: - The LinkedIn script must be blocked by default. - The CMP must fire a consent event that your application listens to. - Only after receiving a positive consent signal should you inject the LinkedIn script. - If the user rejects, the script must never load, and no LinkedIn cookies should be set.

Note that LinkedIn’s Insight Tag is not essential for the core functionality of most websites, so the “strictly necessary” exemption rarely applies. Even if you use GTM’s Consent Mode, LinkedIn tags are not yet fully integrated into Google’s Consent Mode v2, so you must implement custom blocking.

Common Mistakes and How to Avoid Them

Many implementations fail due to subtle issues. Here are the most frequent mistakes and how to prevent them.

1. Loading the Script Unconditionally

A common error is including the LinkedIn script directly in _document.js or as a regular <script> tag without consent checks. This causes the script to load on every page view, regardless of consent. Always conditionally render the script based on consent state.

2. Ignoring Server-Side Rendering

Next.js pre-renders pages on the server, where window and document are not available. If you try to access localStorage or document.cookie during SSR, you’ll get errors. Use useEffect or dynamic imports with ssr: false to ensure consent checks run only on the client.

3. Not Handling Consent Withdrawal

If a user revokes consent, the Insight Tag should stop collecting data. However, simply removing the script from the DOM does not clear already-set cookies. You must actively delete the li_fat_id cookie and any other LinkedIn cookies. Additionally, if you use GTM, you may need to push a consent update to GTM to disable the tag.

4. Using “Implied Consent” or Pre-Ticked Boxes

Under GDPR, consent must be explicit. Pre-ticked boxes or continued browsing as consent are not valid. See EDPB Guidelines 05/2020 on consent. Your banner must have a clear “Accept” and “Reject” button, and the Insight Tag must not fire until the user makes an affirmative choice.

5. Incomplete Privacy Policy Disclosures

Your privacy policy must specifically mention the LinkedIn Insight Tag, the data it collects (e.g., IP address, device information, browsing behavior), and how LinkedIn uses that data. Failing to disclose this can lead to transparency violations.

6. Not Testing the Reject Flow

Many developers test only the accept path. Ensure that when a user clicks “Reject” or closes the banner without accepting, the Insight Tag never loads, even on subsequent page navigations. Use GDPRChecker’s scanner to verify this across multiple pages.

Implementation Checklist

Use this checklist to ensure your LinkedIn Insight Tag Next.js cookie consent setup is complete:

  1. Integrate a CMP that supports granular consent for marketing cookies.
  2. Block the LinkedIn Insight Tag script by default; do not load it in _document.js unconditionally.
  3. Implement a consent state hook that reads from the CMP’s storage (cookie/localStorage).
  4. Conditionally render the LinkedIn script only when marketing consent is true.
  5. Handle consent withdrawal by removing the script and clearing LinkedIn cookies.
  6. If using GTM, configure triggers to fire the LinkedIn tag only on marketing consent.
  7. Test pre-consent state: no LinkedIn network requests or cookies before user interaction.
  8. Test accept flow: Insight Tag loads and li_fat_id cookie is set.
  9. Test reject flow: Insight Tag never loads, even after page navigation.
  10. Update privacy policy to disclose LinkedIn Insight Tag usage and data sharing.
  11. Run a GDPRChecker scan to verify pre-consent blocking and banner behavior.
  12. Schedule recurring scans to maintain compliance over time.

FAQ

What is LinkedIn Insight Tag Next.js cookie consent?

LinkedIn Insight Tag Next.js cookie consent refers to the practice of obtaining user permission before loading the LinkedIn Insight Tag on a Next.js website. It involves blocking the tag’s scripts and cookies until the user explicitly agrees to marketing tracking, in compliance with GDPR and ePrivacy regulations.

Do I need LinkedIn Insight Tag Next.js cookie consent for GDPR?

Yes. The LinkedIn Insight Tag sets non-essential cookies and processes personal data for advertising purposes. Under GDPR, you must obtain prior, informed, and unambiguous consent before activating it. This applies to all Next.js sites targeting users in the European Economic Area.

How do I implement LinkedIn Insight Tag Next.js cookie consent?

Implement by integrating a Consent Management Platform, conditionally loading the LinkedIn script based on consent state, and ensuring no pre-consent network requests. Use Next.js Script component with a custom hook to check consent before rendering the tag.

How can I verify LinkedIn Insight Tag Next.js cookie consent with a scanner?

Use GDPRChecker’s scanner to crawl your site without consent and check for LinkedIn cookies or requests. Then test accept and reject flows. The scanner identifies pre-consent data leaks and missing disclosures, helping you validate your setup.

What are common LinkedIn Insight Tag Next.js cookie consent mistakes?

Common mistakes include loading the script unconditionally, not handling consent withdrawal, using implied consent, ignoring SSR constraints, and failing to test the reject flow. These can lead to unauthorized tracking and GDPR violations.

---

Ready to ensure your LinkedIn Insight Tag is compliant? Run a free scan with GDPRChecker today and close the consent gap on your Next.js site.

GDPRChecker guides are educational resources and do not constitute legal advice. Use them to understand technical and operational privacy requirements, and consult qualified counsel for legal interpretation.

Check Your Website in Under 60 Seconds

  • Sign in required
  • GDPR-focused checks
  • Cookie banner detection
  • Privacy policy verification