GDPRChecker

Home / Knowledge Base / Next.js Consent Withdrawal and Revisit Button Guide: Practical Implementation and Verification

Website Compliance

Next.js Consent Withdrawal and Revisit Button Guide: Practical Implementation and Verification

A practical guide for Next.js developers on implementing a consent withdrawal and revisit button to comply with GDPR. Covers requirements, step-by-step integration with a CMP, common mistakes, and validation using GDPRChecker scans. Includes a checklist and FAQ to ensure ongoing user consent management.

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.

For website owners running Next.js applications, managing user consent under GDPR is not just about displaying a cookie banner—it’s about giving users ongoing control. A Next.js consent withdrawal and revisit button guide addresses a critical compliance requirement: the ability for users to easily withdraw consent and revisit their choices at any time. This guide provides a technical walkthrough for implementing such a mechanism, ensuring your site respects user preferences and aligns with regulatory expectations. We’ll cover what this means for your site, step-by-step implementation, common pitfalls, and how to validate your setup using GDPRChecker’s scanning tools.

This guide is part of GDPRChecker’s knowledge base expansion, focused on practical implementation and verification for our customers. While we provide technical guidance, this is not legal advice. Always consult with a qualified privacy professional for your specific situation.

Requirements and Compliance Expectations

Under GDPR, consent must be freely given, specific, informed, and unambiguous. See EDPB Guidelines 05/2020 on consent. The ability to withdraw consent at any time is a fundamental right. Article 7(3) of the GDPR states that “the data subject shall have the right to withdraw his or her consent at any time.” This withdrawal must be as easy as giving consent. For website owners, this translates into a few key technical requirements:

  • Persistent Access: A mechanism (like a floating button or footer link) must be available on all pages where consent-dependent services run.
  • Immediate Effect: Withdrawal should stop data processing immediately, or as soon as technically feasible.
  • No Degradation of Service: Withdrawing consent should not prevent access to the core functionality of the site, unless the data is strictly necessary for that service.
  • Clear Communication: The button should be labeled clearly, such as “Cookie Settings,” “Manage Consent,” or “Privacy Preferences.”

In Next.js, these requirements intersect with how you manage state. Since Next.js can render pages on the server, you must ensure that consent states are not lost during navigation. Using a CMP that stores consent in a first-party cookie and synchronizes with your tag management system (like Google Tag Manager) is essential. Additionally, if you use Google services, you should implement Google Consent Mode v2 to adjust tag behavior based on consent state. For more on that, see our guide on Google Consent Mode v2.

Regulators expect that the revisit button is not hidden or obscured. It should be part of the normal user interface, not buried in a privacy policy page alone. The EDPB guidelines suggest that a simple link in the footer is acceptable, but a more prominent button may be necessary depending on your user base.

How to Implement Step by Step

Implementing a consent withdrawal and revisit button in Next.js involves several layers: the CMP integration, the UI component, and the verification process. Below is a step-by-step approach.

Step 1: Choose and Configure a CMP

Select a consent management platform that supports a “revisit” or “show preferences” API. Most modern CMPs provide a JavaScript function to reopen the consent dialog. For example, Cookiebot offers Cookiebot.show(), and Usercentrics provides UC_UI.showSecondLayer(). Ensure your CMP is loaded on every page, typically via a script in your custom _app.js or _document.js.

Step 2: Create a Reusable Button Component

In your Next.js project, create a component like ConsentRevisitButton.js. This component should call the CMP’s show function when clicked. Here’s a conceptual example:

const ConsentRevisitButton = () => {
  const handleClick = () => {
    if (typeof window !== 'undefined' && window.Cookiebot) {
      window.Cookiebot.show();
    }
  };

  return (
    <button onClick={handleClick} className="consent-revisit-btn">
      Cookie Settings
    </button>
  );
};

Step 3: Place the Button Consistently

Include this component in a layout wrapper or directly in your footer so it appears on every page. For Next.js, you might add it to your Layout component or _app.js to ensure it persists across route changes.

Step 4: Handle Consent State Changes

When a user updates their preferences via the revisit button, the CMP should fire events that your tag manager listens to. In Google Tag Manager, set up triggers for consent updates to re-evaluate which tags can fire. This is crucial for closing the Consent Mode gap. If you’re using Google Analytics, ensure you’ve configured Consent Mode correctly; see our Google Analytics GDPR compliance guide for details.

Step 5: Test Client-Side and Server-Side Rendering

Next.js can pre-render pages, so your button must work even when JavaScript is disabled? Actually, the button requires JavaScript to function, but the page should still render without it. Ensure the button is not the only way to manage consent—provide a fallback link to a privacy policy page where users can find instructions.

Step 6: Style and Accessibility

Make the button noticeable but not intrusive. Use sufficient color contrast, and ensure it’s keyboard accessible. Add an aria-label if the text is not descriptive enough.

Common Mistakes and How to Avoid Them

Even with a well-intentioned implementation, several mistakes can undermine your compliance efforts. Here are the most common ones and how to avoid them.

Mistake 1: The Revisit Button Only Appears After Consent

Some sites only show the button after the user has made a choice. However, if a user initially rejects all cookies, they still need a way to change their mind later. The button should be visible regardless of consent state.

Mistake 2: Button Does Not Work on All Pages

In Next.js, if you use dynamic routing or client-side transitions, the button might not reinitialize properly. Always test on various page types, including 404 pages and dynamic routes. Use the useEffect hook to ensure the CMP API is available before attaching event listeners.

Mistake 3: Consent Withdrawal Does Not Stop Data Collection

When a user withdraws consent, your tags must stop firing immediately. This requires proper integration between your CMP and tag manager. A common error is that Google Analytics continues to send data because the consent update trigger is not configured. Use GDPRChecker’s scanner to verify that after withdrawal, no non-essential network requests are made. Our Google Consent Mode v2 checker can help identify gaps.

Mistake 4: Ignoring Pre-Consent Requests

Before consent is given, your site should not fire non-essential tags. In Next.js, this can be tricky because server-side rendered pages might include scripts that execute before the CMP loads. Use the next/script component with the strategy="afterInteractive" attribute to delay non-essential scripts until after the page is interactive and consent has been evaluated.

Mistake 5: The Button Is Not Tested Across Devices

Mobile responsiveness is critical. A button that works on desktop might be hidden behind a hamburger menu on mobile. Ensure the revisit button is easily accessible on all screen sizes.

Mistake 6: Assuming One-Time Setup Is Enough

Consent requirements evolve, and your CMP or tags may update. Regularly scan your site with GDPRChecker to catch new issues. After any deployment, run a scan to confirm the button still works and consent states are respected.

How to Validate with GDPRChecker

After implementing your consent withdrawal and revisit button, validation is essential. GDPRChecker provides automated scans that simulate user interactions and verify compliance. Here’s how to use it effectively:

  1. Pre-Consent Scan: Run a scan without accepting cookies. GDPRChecker will list all network requests and identify any that fire before consent. This helps you close the pre-consent gap.
  2. Post-Consent Scan: Accept all cookies and run another scan. Then, use the revisit button to withdraw consent and scan again. The tool should show that non-essential requests stop.
  3. Banner Behavior Check: GDPRChecker can verify that your cookie banner appears correctly and that the revisit button triggers it again.
  4. Disclosure Verification: The scanner checks for required disclosures in your cookie banner and privacy policy. Ensure your policy explains how to withdraw consent, and link to it from the button if needed.

GDPRChecker scans help verify pre-consent network requests, banner behavior, and disclosure gaps after changes. By integrating these scans into your development workflow, you can catch regressions early. For a broader view of cookie banner requirements, see our cookie banner requirements guide.

Implementation Checklist

Use this checklist to ensure your Next.js consent withdrawal and revisit button is properly implemented and verified:

  1. Select a CMP that supports a revisit/show preferences API.
  2. Integrate the CMP script in your Next.js _app.js or _document.js.
  3. Create a reusable ConsentRevisitButton component that calls the CMP’s show function.
  4. Place the button in a persistent location (e.g., footer) on all pages.
  5. Ensure the button is visible and functional regardless of consent state.
  6. Configure Google Consent Mode v2 to adjust tag behavior based on consent.
  7. Set up GTM triggers to re-evaluate tags on consent update events.
  8. Test the button on all page types, including dynamic routes and 404 pages.
  9. Verify that withdrawing consent stops all non-essential network requests.
  10. Run GDPRChecker scans before consent, after consent, and after withdrawal.
  11. Check mobile responsiveness and accessibility of the button.
  12. Document the implementation and schedule regular compliance scans.

FAQ

What is Next.js consent withdrawal and revisit button guide?

This guide explains how to implement a persistent button in Next.js applications that allows users to withdraw or change their cookie consent at any time, ensuring ongoing GDPR compliance.

Do I need Next.js consent withdrawal and revisit button guide for GDPR?

Yes, if your Next.js site uses cookies or tracking technologies that require consent, you must provide an easy way for users to withdraw that consent, typically via a revisit button.

How do I implement Next.js consent withdrawal and revisit button guide?

Integrate a CMP with a show-preferences API, create a reusable button component in Next.js, place it consistently across pages, and configure your tag manager to respect consent updates.

How can I verify Next.js consent withdrawal and revisit button guide with a scanner?

Use GDPRChecker to scan your site before and after consent withdrawal. The scanner will detect if non-essential requests continue after withdrawal, indicating a compliance gap.

What are common Next.js consent withdrawal and revisit button guide mistakes?

Common mistakes include hiding the button until after consent, not testing on all page types, failing to stop data collection on withdrawal, and neglecting mobile accessibility.

Next Steps for Your Next.js Compliance

Implementing a consent withdrawal and revisit button is a key step in closing your website’s compliance gaps. By following this guide, you’ve addressed the Cookie Banner gap and taken steps toward a more privacy-respecting site. However, compliance is an ongoing process. Regularly scan your site with GDPRChecker to ensure new deployments don’t introduce issues. Explore our related guides on Google Consent Mode v2 vs Google Certified CMP and whether you need a CMP if you don’t run Google Ads to deepen your understanding.

Ready to verify your implementation? Run a GDPRChecker scan now and confirm that your Next.js site respects user consent at every step.

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