My place in the WordPress community
- I have had a wordpress.org account since 2006.
- I contributed to WordPress core for versions 7.0 and 7.1.
- I maintain 30 plugins on wordpress.org.
- I organise and speak at WordCamps.
- I have attended every WordCamp Europe from 2017 to 2026.
I build Next.js applications as a one-person business in Gdynia, Poland, and my name is Mariusz Szatkowski. This page takes the cookie guidelines of the Italian Garante per la protezione dei dati personali, whose seat is in Piazza Venezia in Rome, and turns them into decisions for a Next.js codebase. It covers one topic: the consent flow.
What the Garante adopted, and what it replaced
The Garante adopted its guidelines on cookies and other tracking tools on 10 June 2021, as measure no. 231, and they appeared in Gazzetta Ufficiale no. 163 of 9 July 2021. They rest on article 122 of the Italian privacy code, which transposes the ePrivacy directive, and on the GDPR definition of consent. The text sets a period of six months from publication for processing already in place to conform, and says that consents collected earlier stay valid if they meet the GDPR conditions and were recorded.
The guidelines sort tools into two groups. Technical cookies serve only to transmit a communication or to provide a service the user asked for. Profiling cookies tie behaviour to an identified or identifiable person. They also say fingerprinting, a passive technique, belongs with the rest.

Photo: Krzysztof Golik, CC BY-SA 4.0, Wikimedia Commons.
Rule one: nothing but technical tools on the first visit
The central requirement is privacy by default. On the first visit to a site, no cookie or other tool except technical ones is placed on the device, and no active or passive tracking technique is used. The Garante describes this as an obligation whose breach can be sanctioned under the GDPR.
In a Next.js App Router project this has a concrete meaning. The root layout must not render a tag manager, a pixel or an analytics script unconditionally. The next/script component loads its default strategy, afterInteractive, on every page that renders it, so the script must be rendered only after a recorded choice. The consent component is therefore the only place in the project that imports a tracker.
Rule two: what the banner must contain
The guidelines suggest a banner model that the Garante considers in line with its obligations. A site may use another model, but it has to prove that it is equivalent. The model contains:
- A close control, an X at the top right, that keeps the default settings. The banner must say so. The X has to be as visually prominent as the other controls.
- A short notice that the site uses technical cookies and, only with consent, may use profiling cookies or tracking for advertising, personalisation or analysis of visitor behaviour.
- A link to the full privacy information, reachable in one click, and also in the footer of every page.
- A control to accept all.
- A link to an area where the visitor chooses by function, third party and cookie, with every granular choice preset to denial.
The Garante adds that controls should have the same size, emphasis and colours, so design cannot push a visitor to one option. The positive action may only express consent, never a refusal. The visitor must be able to change the choice at any time, through a link in the footer worded like “review your cookie choices”, and it names as good practice a small icon on every page that shows the state of the choices.
Scrolling is addressed directly. The Garante shares the EDPB view that scrolling alone is never consent. It leaves room for scrolling as one part of a longer procedure that yields an unambiguous, recordable choice, but it asks controllers to treat any such design with great rigour. I do not build consent from scrolling.
Rule three: a refusal is remembered
The guidelines also deal with banners that return on every visit. When a visitor keeps the defaults or consents to only some cookies, the choice is recorded and consent is not asked again, except in three cases:
- the conditions of the processing change significantly, for example the third parties;
- the site cannot know that a cookie was already stored, for instance after the visitor deleted cookies;
- at least six months have passed since the banner was last shown.
A later choice overwrites the earlier one. The Garante says the choices may be stored in technical cookies, which is the mechanism I use.
Rule four: no cookie wall
The guidelines call a take it or leave it mechanism unlawful because it defeats the freedom of consent, except, to be checked case by case, where the site offers equivalent content or service without consent and the alternative itself respects the GDPR principles. In a Next.js project that means no middleware or layout that redirects a visitor who has not accepted.
Rule five: analytics cookies
Analytics can be treated like technical cookies only with minimisation. For third-party measurement the Garante names masking at least the fourth component of an IPv4 address, which leaves an uncertainty of 1 in 256, and similar steps for IPv6. It also asks that analytics produce aggregated statistics only, serve a single site or app, and are not combined with other data or passed on. Without those conditions, analytics need the same consent as any other profiling.
How this looks in Next.js
One technical decision comes first. The cookies() function from next/headers reads request cookies on the server, but the Next.js documentation says that using it in a layout or page opts the route into dynamic rendering when Cache Components are not used. A consent banner in the root layout that reads the cookie on the server would make every page dynamic. Setting a cookie is also only supported in a Server Function or a Route Handler, not while a Server Component renders.
So the choice is read and written in a client component. The server renders the same static HTML for everyone, and the browser decides what loads:
'use client'
import { useEffect, useState } from 'react'
import Script from 'next/script'
type Choice = 'granted' | 'denied'
const COOKIE = 'consent_analytics'
const SIX_MONTHS = 60 * 60 * 24 * 183
function readChoice(): Choice | null {
const hit = document.cookie.split('; ').find((c) => c.startsWith(`${COOKIE}=`))
const value = hit?.split('=')[1]
return value === 'granted' || value === 'denied' ? value : null
}
function writeChoice(choice: Choice) {
document.cookie = `${COOKIE}=${choice}; Max-Age=${SIX_MONTHS}; Path=/; SameSite=Lax; Secure`
}
export function ConsentGate() {
const [choice, setChoice] = useState<Choice | null>(null)
const [ready, setReady] = useState(false)
useEffect(() => {
setChoice(readChoice())
setReady(true)
}, [])
function decide(next: Choice) {
writeChoice(next)
setChoice(next)
}
return (
<>
{ready && choice === null && (
<div role="dialog" aria-label="Cookies">
<button type="button" aria-label="Close and continue without cookies" onClick={() => decide('denied')}>X</button>
<p>Short notice, link to the full policy.</p>
<button type="button" onClick={() => decide('granted')}>Accept</button>
<button type="button" onClick={() => decide('denied')}>Reject</button>
</div>
)}
{choice === 'granted' && (
<Script id="stats" src="https://stats.example.com/script.js" strategy="afterInteractive" />
)}
</>
)
}The cookie lasts about six months, which matches the period the Garante names for not asking again after a refusal. The sample is a skeleton: the real banner adds the granular area, the footer link and the state icon, with your texts and your layout.
Four checks go into acceptance:
- Open the site in a clean profile and read the network panel before touching the banner. Only your own origin may appear.
- Close the banner with the X, reload, and confirm that nothing but technical items was stored and that the banner does not return.
- Accept, confirm that the agreed scripts load, then use the footer link, withdraw and confirm that they stop on the next load.
- Delete the cookies and confirm that the banner returns.
How a project runs with me
- Written brief: the pages, the languages, the tools you want, such as analytics, video or chat.
- A tracker catalogue in the repository that lists every tool with its purpose, and that your counsel or data protection officer approves. The consent component reads it.
- Written scope and assumptions. I design the layout and wireframes myself, or build from yours, into the banner and the pages.
- Staging and acceptance with the four checks above, recorded in writing.
- Handover: the catalogue, the checks and a note on the six month rule.
I do not write your privacy policy or decide your legal basis. Everything is remote and written, so there are no meetings or calls.
A checklist you can use without hiring me
| Question | A good answer |
|---|---|
| What loads before the first click? | Technical items only |
| Does the X keep the defaults and say so? | Yes |
| Do accept and reject look equal? | Same size, emphasis and colours |
| Does a visitor reach the privacy information in one click? | Yes, also from the footer |
| Can a visitor change the choice on any page? | Yes, from a footer link |
| Is a refusal remembered for at least six months? | Yes, with the listed exceptions |
| Are analytics minimised or consented? | One of the two, documented |
| Does the consent code read cookies in a layout? | No, in a client component |
What I need from you
- The list of tools you plan to run, and your decision on each purpose.
- The privacy texts, written by whoever is responsible for them.
- The layout for the banner and the preferences area.
- Who approves the tracker catalogue.
Questions Rome companies ask
Does scrolling count as consent in Italy?
No. The Garante agrees with the EDPB that scrolling is unsuitable on its own for collecting consent to profiling cookies. It may be one component of a longer process that produces a clear, recorded choice.
What does closing the banner with the X do?
It keeps the default settings: the visit continues with technical cookies only. The Garante asks for a warning to that effect in the banner, and for the X to be as prominent as the other controls.
How long before I may show the banner again after a refusal?
The guidelines say at least 6 months from the previous banner, unless the conditions of the processing changed significantly or the site cannot tell that a cookie was stored earlier, for example after the visitor deleted cookies.
Are analytics cookies technical cookies?
They can be treated that way if the data is minimised. The Garante names masking at least the fourth component of an IPv4 address, use on a single site, aggregated statistics, and no combination with other data. Without that, they need consent.
Can the site refuse access to visitors who reject cookies?
Not as a take it or leave it wall. The Garante calls that unlawful unless, case by case, the site offers equivalent content or service without consent and that alternative itself complies with the GDPR principles.
Why read the consent in a client component?
Reading cookies in a Next.js layout opts the route into dynamic rendering. A client component reads the choice in the browser, so the pages stay static and the banner decides what loads. The wider service is described on the Next.js developer page.
Write to me
Send me the site address, the tools you run and the deadline. Questions come back in writing, followed by a written estimate that states scope and assumptions. The first estimate is free. I reply within 24 hours on working days (CET). Use the contact page.
Selected projects
Examples of my work.
frems.pl - WordPress Project | WPPoland
The website frems.pl is a modern online platform presenting the offer of the manufacturer and distributor of medical equipment specializing in FREMS technolo...
funderwear.pt - Premium Underwear E-commerce Platform
Funderwear.pt is a WooCommerce online store that meets the needs of even the most demanding customers looking for unique gifts or wanting to treat themselves to premium, fun-designed underwear.
Healthcare Website: fermentum-mobile.pl
The website fermentum-mobile.pl is a dedicated platform created for fermentation enthusiasts who wish to explore traditional processing methods and discover ...
WordPress support & development in Rome
Need this service: Next.js developer in Rome?
Describe your project by e-mail. I reply within 24 hours.
Describe your projectExplore other WordPress services and knowledge base
CrUX field-data audit with per-template LCP, INP, CLS attribution.
Core Web Vitals, caching, and faster delivery.
A free check of your site's public version, results on screen.
Stability, updates, and post-launch support.
Updates checked before release, with a report.
Migration to Astro, Next.js, and headless WordPress.
Audit, hardening, and incident risk reduction.
Related categories
Supporting articles

How to optimize Interaction to Next Paint (INP) on WordPress sites. Practical fixes for the newest Core Web Vital metric that directly impacts Google rankings.

Field versus lab, LCP, INP and CLS for WordPress in 2026. Google's green LCP is still 2.5 s in CrUX. 100/100 in Lighthouse is a lab target. Edge HTML, consent banners, checkout widgets.

How we took a slow WooCommerce site from score 45 to 100. A technical deep dive into Speculation Rules, AVIF, and Critical CSS in 2026.