Opt-in and Opt-out Consent on Client Websites

Opt-in and Opt-out Consent on Client Websites

Opt-in means a site waits for a clear yes before it runs non-essential cookies or trackers. Opt-out means they run until the visitor says no. GDPR requires opt-in, while the CCPA and most US state laws use opt-out and count a Global Privacy Control signal as one.

Opt-in and opt-out consent, defined

Opt-in and opt-out are the two default states a website can start from when it asks visitors about tracking. Under opt-in, non-essential trackers such as analytics tags and ad pixels stay off until the visitor gives an active yes, such as clicking Accept. With opt-out, the same trackers run from the first page view, and the visitor has to act to stop them. Strictly necessary cookies, such as a login session or a cart, don’t need consent under either model.

The law decides which default a site may use. GDPR and the ePrivacy rules require opt-in before non-essential cookies are set in the EU and the UK. California’s CCPA, as amended by the CPRA, lets a site track by default but gives visitors the right to opt out of the sale and sharing of their data. A Global Privacy Control signal counts as that opt-out.

What opt-in and opt-out mean

The terms name who has to act: opt-in puts the effort on the site, which must hold every non-essential tracker until it gets a yes, and opt-out puts it on the visitor.

Why the consent model matters on a client site

You pick the default when you set up a client site, and an early tracker becomes your problem when the client gets a complaint. EU or UK visitors should get opt-in.

Which laws require opt-in and which allow opt-out

GDPR and the ePrivacy rules in the EU and UK

Non-essential cookies need consent first, so a tracker that sets one before the visitor clicks Accept breaks the rule. On a Munich bakery site with the Meta pixel in the theme header, the _fbp cookie lands while the banner waits.

CCPA and CPRA in California

The site may track by default but must stop selling and sharing data once the visitor opts out. When you set up a CCPA cookie banner on a client site, the banner handles a GPC signal like this:

  • the banner is skipped and a reject is recorded
  • the Do Not Sell flag is set and a short notice shows

LGPD in Brazil

Consent is one of several legal bases under the LGPD, and a site relying on it needs consent that is free, informed, and unambiguous before the tracker runs.

Other US state privacy laws

Virginia needs opt-in before a site processes sensitive data, and Colorado and Connecticut do too, while other data follows opt-out. California instead gives a right to limit sensitive data use. Browsers send GPC to sites in every state, as how Global Privacy Control reaches a site explains. This section isn’t legal advice.

How opt-in and opt-out work on a website

The default state before the first click

A first-time visitor to an opt-in site holds only necessary cookies while the banner waits.

What runs before the visitor chooses

Under opt-in, trackers that load on page view collect data before anyone agrees, unless the banner holds them. ConsentLayer blocks known trackers until consent, then runs them. The ConsentLayer tag must load synchronously, with no defer and no async, before other scripts.

Choices by category

Visitors can accept statistics and refuse marketing, which decides the Google signals the site sends. Essential maps to functionality_storage and security_storage, Statistics to analytics_storage, and Marketing to ad_storage, ad_user_data, and ad_personalization.

Changing the choice later

A visitor who withdraws consent expects tracking to stop and cookies to go. ConsentLayer deletes that category’s cookies and logs the change. Test in a private window, because your browser keeps your last test’s consent and hides the banner.

  1. Accept all and note the _ga cookies.
  2. Switch Statistics off and reload.
  3. Confirm _ga is gone and the consent log shows the withdrawal.

Common misunderstandings about opt-in and opt-out

A banner with buttons is an opt-in

What counts is the list of trackers that loaded before anyone clicked.

  1. Open the site in a private window without clicking.
  2. Filter the Network tab for facebook and doubleclick.
  3. Run a ConsentLayer scan. It checks up to 10 URLs against its service library.

A pre-ticked box counts as consent

The EU Court of Justice ruled in the Planet49 case in 2019 that a pre-ticked box isn’t a valid opt-in under GDPR. A Marketing toggle that starts on doesn’t record consent.

An opt-out site needs no banner

A California visitor still needs notice at collection and a way to opt out, such as a “Do Not Sell or Share” link, and may send GPC on the first page view. Set up the Do Not Sell link and the opt-out signal on the site.

Opt-in and opt-out FAQ

Can one client site use opt-in for EU visitors and opt-out for California visitors?

It can on Solo and up, where region rules target the EU/EEA and UK block, 65 countries, and 51 US states including DC, while Free shows one banner to everyone.

How long does an opt-in choice last?

Consent lasts 365 days by default, so returning visitors see the banner again after a year.

Do visitors need to opt in again after you add a new tracker?

They do, since their earlier yes didn’t cover the new tracker. Bump the consent version and every visitor sees the banner again.

Do you need to keep a record of each opt-in?

GDPR expects you to prove consent was given, and ConsentLayer logs each decision from the first visitor, on every plan.

Opt-in and opt-out in practice on one client site

For a mostly EU client, prompt your agent, and replace the placeholder with the client’s real domain:

Set up ConsentLayer for <your-client-domain>. Most visitors are in the EU.

Your agent calls setup_site, which creates the site and scans it. It then configures consent categories and returns the snippet with a real project key. The site keeps the default, opt-in, which GDPR needs. For the next site, set up consent by telling your coding agent. Without an agent, sign in through your browser and add the site in the dashboard.

The site is protected once the snippet is live in <head> on the real domain, with blocking on and decisions recorded. Confirm in a private window that no Meta request fires before you click.

See how ConsentLayer holds trackers until consent and records every decision on your client sites.