LGPD Developer Hub

Everything you need to implement LGPD-compliant cookie consent from scratch — script blocking, Google Consent Mode v2, WordPress, and Shopify integration guides with working code.

What do developers need to implement for LGPD compliance?

Three things. First, block all non-essential scripts before consent using MutationObserver or type rewriting — no tracking script may execute until the visitor actively accepts. Second, fire gtag('consent', 'default', {...}) synchronously before any Google tag loads. Third, store a tamper-proof consent record with timestamp, categories consented to, and banner version for ANPD audit purposes.

CookieFácil handles all three automatically with a single script tag placed first in your HTML <head>. The guides below cover manual implementation and integration specifics for each platform.

Developer guides

Choose your integration path. Each guide has working code examples.

JavaScript Implementation

MutationObserver script blocking, type rewriting, and consent state management. Works with any framework or plain HTML.

  • Script blocking before consent
  • Dynamic script interception
  • Consent state API
Read guide

Google Consent Mode v2

Exact gtag() calls, default denied state, update triggers, and category-to-signal mapping for LGPD.

  • Copy-paste default snippet
  • LGPD category → GCM signal mapping
  • wait_for_update explained
Read guide

WordPress Integration

Script placement via wp_head priority 1, caching plugin compatibility, and how to handle third-party plugin scripts.

  • wp_enqueue_script setup
  • Cache plugin compatibility
  • Plugin conflict resolution
Read guide

Shopify Integration

theme.liquid placement, ScriptTag API for app developers, and Shopify Markets support for Brazilian customers.

  • theme.liquid script placement
  • ScriptTag API for app devs
  • Shopify Markets + Brazil
Read guide

Quick start — any platform

Paste this as the first script inside your <head> tag. Replace YOUR_SITE_ID with the ID from your CookieFácil dashboard.

<!-- CookieFácil LGPD Consent Manager — must be FIRST script in <head> -->
<script data-cfasync="false"
        src="https://cdn.cookiefacil.com.br/cdn/cf-banner.min.js?site=YOUR_SITE_ID"
        async></script>

The data-cfasync="false" attribute prevents Cloudflare Rocket Loader from deferring this script.

Choose the right plan for your business

Start free and scale as your consent volume grows. Billed in BRL — no credit card required to start.

Free

Start collecting consent records


  • 1 site · 1,000 visitors/month

  • Cookie consent banner — LGPD + GDPR ready

  • Basic consent reports

Start Free
Most Popular

Basic

For growing businesses


  • 2 sites · 5,000 visitors/month

  • CSV export of consent records

  • Remove CookieFácil branding

Get Started

Professional

For multiple sites and agencies


  • 5 sites · 50,000 visitors/month

  • CSV + PDF + advanced reports

  • Custom CSS and geo-targeting rules

Get Started

Frequently asked questions

  • What do developers need to implement for LGPD compliance?

    Three things: block non-essential scripts before consent using MutationObserver or type rewriting, fire gtag('consent', 'default', {...}) before any Google tag loads, and store a tamper-proof consent record with timestamp, categories, and banner version for ANPD audits.

  • Does LGPD require script blocking on the server or client side?

    Client side. LGPD compliance is enforced in the browser — non-essential scripts must not execute before the visitor gives consent. Server-side rendering does not bypass this requirement. The consent banner must load and resolve before any tracking code fires.

  • What is the fastest way to become LGPD-compliant as a developer?

    Add one script tag as the first item in your HTML <head>. CookieFácil handles script blocking, consent UI, Google Consent Mode v2, and consent logging automatically. Setup takes under 5 minutes on any platform.

  • Do I need to implement LGPD compliance separately for each framework?

    No. The consent script is framework-agnostic — one JavaScript tag works with React, Next.js, Vue, Angular, WordPress, Shopify, and plain HTML. The framework-specific guides on this hub cover script placement only, not different logic.