--- url: "https://web.dev/articles/cookie-notice-best-practices" titulek: "Best practices for cookie notices | Articles | web.dev" h1: "Best practices for cookie notices Stay organized with collections Save and categorize content based on your preferences." popis: "Learn about how cookie notices affect performance, performance measurement, and UX." jazyk: "en" kanonicka: "https://web.dev/articles/cookie-notice-best-practices" drobecky: ["Articles", "Best practices for cookie notices"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 21:35:09" znaku: 16146 slov: 2393 kodovani: "iso-8859-2" sha256: "2645b2aa386ebaee51906a36ebe6b20befd53a301f5063280a4c82992f714bd9" --- Best practices for cookie notices Stay organized with collections Save and categorize content based on your preferences. Optimize cookie notices for performance and usability. Katie Hempenius Barry Pollard This document discusses how cookie notices can affect performance, performance measurement, and user experience. Performance Cookie notices can have a significant impact on page performance due to the fact that they are typically loaded early in the page load process, are shown to all users, and can potentially influence the loading of ads and other page content. Here's how cookie notices can impact Web Vitals metrics: **[Largest Contentful Paint (LCP)](/articles/lcp):** Most cookie consent notices are fairly small and therefore typically don't contain a page's LCP element. However, this can happen—particularly on mobile devices. On mobile devices, a cookie notice typically takes up a larger portion of the screen. This usually occurs when a cookie notice contains a large block of text (text blocks can be LCP elements too). **[Interaction to Next Paint (INP)](/articles/inp):** Cookie notices can often be a cause for high INP as they typically add a lot of third-party scripts when accepted. The main issue is often to do the **Accept** interaction as that results in a lot of processing to add those third-party scripts all at once. Refer to the Best Practices section on how to mitigate this. **[Cumulative Layout Shift (CLS)](/articles/cls):** Cookie consent notices are a very common source of layout shifts. Generally speaking, you can expect a cookie notice from third-party providers to have a greater impact on performance than a cookie notice that you build yourself. This is not a problem unique to cookie notices—but rather the nature of third-party scripts in general. Best practices The best practices in this section focus on third-party cookie notices. Some, but not all, of these best practices will also be applicable to first-party cookie notices. Understand the INP impact of cookie notices As mentioned previously, the **Accept** button is often a particular cause of INP issues due to the large amount of processing that happens when it's clicked. The Chrome team has worked with a number of Consent Management Platforms (CMP) to yield after clicking accept to allow the browser to acknowledge that acceptance quickly in the next paint. See this [PubTech case study](/case-studies/pubconsent-inp) as an example. If your CMP is affected by this, try reaching out to them to see if they can similarly avoid INP issues for sites embedding it. See the [Optimize Long Tasks article](/articles/optimize-long-tasks) for guidance on yielding tactics. Cookie notice scripts should be loaded asynchronously. To do this, add the [`async`](https://developer.mozilla.org/docs/Web/HTML/Element/script#attr-async) attribute to the script tag. `