All posts

Blog

Cookie Consent Explained: GDPR, CCPA and What Website Owners Should Know

Illustrated cover for the Security & SSL guide "Cookie Consent Explained: GDPR, CCPA and What Website Owners Should Know"

Cookie banners have become part of the furniture of the web. Most visitors click them away without reading. But behind those banners are real legal rules, and getting them wrong can mean complaints, platform problems or fines in some jurisdictions.

This guide gives website owners a practical overview of cookie consent under the EU's GDPR and the US CCPA, and how to set up a sensible approach for a small site.

Not legal advice: This is a general overview to help you understand the landscape. Rules differ by country and state, they are enforced differently, and they change. Consult a qualified privacy attorney for advice about your specific situation.

What cookies are (and what else counts)

A cookie is a small text file a website stores in a visitor's browser. Cookies remember things like login sessions, shopping cart contents, language preferences and analytics identifiers.

Privacy rules usually cover more than just cookies. Similar technologies such as local storage, tracking pixels, device fingerprinting and SDKs are often treated the same way. When this article says "cookies," it means all of these.

First-party vs third-party cookies

  • First-party cookies are set by your own domain, such as a login cookie for your store.
  • Third-party cookies are set by other domains loaded on your page, such as ad networks, embedded videos or social media widgets.

Categories you will see in consent tools

  • Strictly necessary: needed for the site to work, such as session, security and cart cookies.
  • Preferences: remember choices like language or region.
  • Analytics/statistics: measure how people use the site.
  • Marketing/advertising: track visitors across sites to show targeted ads.

The EU approach: GDPR and the ePrivacy rules

In the European Union, two sets of rules work together. The ePrivacy Directive (often called the "cookie law") requires consent before storing or reading non-essential cookies on a user's device. The GDPR defines what valid consent looks like.

Under that framework, consent generally needs to be:

  • Freely given: visitors shouldn't be forced to accept non-essential cookies to use the site, in most cases.
  • Specific: consent per purpose, not one blanket "yes" to everything hidden behind vague wording.
  • Informed: people need clear information about what each category does.
  • Unambiguous: a clear affirmative action. Pre-ticked boxes and "by continuing to browse you accept" are generally not considered valid consent.
  • Easy to withdraw: withdrawing should be as easy as giving consent.

In practice, that means non-essential cookies such as analytics and advertising should not load until the visitor opts in. Strictly necessary cookies don't need consent, but you should still explain them.

The UK has very similar rules under UK GDPR and its own electronic communications regulations.

Does GDPR apply to a US website?

It can. The GDPR can apply to businesses outside the EU that offer goods or services to people in the EU or monitor their behavior. A US plumber serving one city is in a very different position from a US online store shipping to Europe. If you actively target EU or UK customers, take these rules seriously.

The US approach: CCPA/CPRA and state laws

The US does not have a single federal cookie consent law. Instead, a growing patchwork of state privacy laws applies, with California's CCPA (as amended by the CPRA) being the best known.

The CCPA works differently from the GDPR:

  • It applies to businesses that meet certain thresholds, such as revenue, volume of personal information handled, or revenue from selling or sharing data. Many very small businesses fall below them, but check the current thresholds.
  • It is mostly opt-out, not opt-in. Rather than asking permission before every analytics cookie, it gives consumers the right to opt out of the "sale" or "sharing" of their personal information, which can include some advertising and cross-site tracking.
  • Covered businesses that sell or share data generally need a clear link such as "Do Not Sell or Share My Personal Information" and must honor opt-out preference signals like Global Privacy Control (GPC).

Other states, including Virginia, Colorado, Connecticut and more, have their own laws with different thresholds and details. The trend is clearly toward more regulation, not less.

What a good cookie banner looks like

Whatever rules apply to you, a well-designed consent experience tends to share these traits:

  1. Clear choices up front: "Accept all," "Reject all" and "Customize" or "Manage preferences," with the reject option as easy to find as accept.
  2. Plain language: say what the cookies do, such as "help us understand which pages are popular" or "show you relevant ads on other sites."
  3. Granular controls: let people toggle analytics and marketing separately.
  4. Actually blocks scripts: non-essential scripts shouldn't fire until consent is given where opt-in is required. A banner that looks nice but loads everything anyway doesn't do its job.
  5. A way to change your mind: a "Cookie settings" link in the footer that reopens preferences.
  6. Records of consent: good consent tools log when and how consent was given.

Dark patterns to avoid

  • Hiding "Reject" behind multiple clicks while "Accept" is one big button
  • Pre-ticked boxes for non-essential categories
  • Cookie walls that block the whole site unless the visitor accepts tracking
  • Vague wording like "We use cookies to improve your experience" with no detail

Regulators in Europe have specifically criticized these practices.

Practical steps for a small website

Step 1: Audit your cookies

Find out what your site actually sets. You can:

  • Open your browser's developer tools, go to the Application or Storage tab, and look at cookies while browsing your site in a private window.
  • Use a cookie scanning tool, many of which are built into consent platforms.
  • List every plugin, embed and script: analytics, chat widgets, video embeds, ad pixels, social buttons, maps.

Step 2: Remove what you don't need

The easiest cookie to manage is one you don't set. If you installed a social share plugin three years ago and nobody uses it, remove it. Fewer scripts also tend to mean a faster site.

Step 3: Consider privacy-friendlier analytics

Some analytics tools are designed to work without cookies or personal identifiers. Whether they remove the need for consent depends on the tool and the jurisdiction, so read the vendor's documentation and get advice if you rely on that.

Step 4: Choose a consent tool

For WordPress, there are several consent management plugins. Hosted consent management platforms also work on any site. Look for:

  • Automatic script blocking until consent
  • Geo-targeting, if you want different behavior for EU and US visitors
  • Support for Google Consent Mode if you use Google tags
  • Respect for Global Privacy Control signals
  • Consent logs

Step 5: Update your privacy policy

Your cookie banner should link to a cookie section or cookie policy that explains each category. See our guide on whether your website needs a privacy policy for what to include.

Step 6: Test it

Open your site in a private window, reject all cookies, and check developer tools. Analytics and marketing cookies shouldn't appear. Then accept and confirm they do. Repeat after adding new plugins.

Wrapping up

Cookie consent boils down to three ideas: know what your site sets, be honest with visitors about it, and give them real choices that your site actually respects. GDPR leans toward opt-in consent for non-essential cookies, while US state laws like the CCPA lean toward opt-out rights for selling and sharing data. Audit your scripts, trim what you don't need, use a consent tool that genuinely blocks tracking, and get legal advice if your business clearly falls under these laws.