What this page covers
A practical introduction to GDPR, CCPA, COPPA, implementation basics, and code examples that connect policy to actual website behavior.
Understand global privacy laws and learn how to implement them correctly - with real examples anyone can follow.
A practical introduction to GDPR, CCPA, COPPA, implementation basics, and code examples that connect policy to actual website behavior.
Start with the quick checklist, then read the law summaries, and finally use the implementation and code sections to connect theory to action.
Privacy is not just policy text. It shapes when tags can fire, what data can move, and what proof your team needs during implementation or audits.
Start here if you need to get compliant quickly. These are the essential steps every website should take:
Create a page explaining what data you collect and why. Link it in your footer.
Use a Consent Management Platform (CMP) to ask users for permission before tracking them.
Only load tracking scripts (Google Analytics, Facebook Pixel, etc.) AFTER users give consent.
Add a way for users to request their data or ask for deletion (email address is fine to start).
Only collect what you actually need. Don't ask for phone numbers if you'll never call.
In Plain English: If you have visitors from Europe, you need their permission before tracking them. Be transparent about what you collect and why.
Any website or business that:
Wrong Way:
Your website loads Google Analytics automatically when someone visits from Germany. You don't have a cookie banner.
Right Way:
When someone from Germany visits, they see a banner: "We use cookies to improve your experience. Accept or Reject?" Google Analytics only loads if they click Accept.
Ask permission BEFORE setting cookies or tracking users. Pre-checked boxes don't count.
Your privacy policy must explain: what data you collect, why you need it, who you share it with, and how long you keep it.
Users can request: access to their data, corrections, deletion, or a copy to take elsewhere.
If you get hacked and user data is exposed, you must report it to authorities within 72 hours.
Pro Tip: Use Google Consent Mode v2 to keep measuring website performance even when users decline cookies. It uses privacy-safe modeling instead of individual tracking.
In Plain English: California residents can see what data you have about them, ask you to delete it, and stop you from selling it to others.
Businesses that meet ANY of these criteria:
Scenario: You run an e-commerce site and share customer emails with Facebook for ad targeting.
Wrong Way:
No mention of data sharing. No way for users to opt out.
Right Way:
Your homepage has a "Do Not Sell My Personal Information" link. When clicked, you stop sharing that user's data with Facebook and other partners.
Must be on your homepage or in your footer. When clicked, stop sharing their data with third parties.
Users can request: what data you have, who you shared it with, and deletion. You have 45 days to respond.
List all categories of personal data you collect and all third parties you share it with.
In Plain English: If your website or app is for kids under 13, you need parental permission before collecting ANY personal information.
Scenario: You create a kids' game app that lets children create accounts.
Wrong Way:
Kids can sign up with just an email. You show them personalized ads based on their gameplay.
Right Way:
Kids enter their parent's email. Parents get a verification email and must approve the account. No personalized ads or tracking. Only show age-appropriate, contextual ads.
Before collecting emails, names, photos, or location from kids under 13.
Don't track kids across websites or build profiles for targeted advertising.
Use encryption and limit who can access children's data.
Important: YouTube, TikTok, and most social media require users to be 13+ for this reason. If your service is for kids, disable all tracking by default.
India's Digital Personal Data Protection Act is similar to GDPR but with some differences.
Get consent before processing data
Allow users to access and delete their data
Document how you transfer data outside India
Brazil's General Data Protection Law (LGPD) is heavily inspired by GDPR.
Have a legal basis for data processing
Appoint a data protection officer
Report data breaches to authorities
Use a Consent Management Platform (CMP) to show a banner and collect user choices.
Popular CMPs (pick one):
What this does: Shows a banner asking users to accept/reject cookies. Stores their choice and tells your tracking tools whether they consented.
Use Google Tag Manager to control when tags fire based on user consent.
In Google Tag Manager:
Pro Tip: Essential cookies (like shopping cart) don't need consent. Only marketing and analytics cookies do.
Your privacy policy should explain in plain language:
Template generators: Use tools like TermsFeed or FreePrivacyPolicy to create a basic policy, then customize it.
Add this to your website's <head> section BEFORE any tracking scripts:
<script>
// Set default consent state (denied until user accepts)
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
</script>
When user accepts cookies, update consent:
gtag('consent', 'update', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted'
});
Create a custom JavaScript variable in GTM to check if user gave consent:
function() {
// Check if analytics consent was granted
var consent = {{Consent State}}; // Your CMP variable
return consent && consent.analytics === true;
}
Use this variable as a trigger condition for your GA4 tag.
A simple banner you can customize:
<div id="cookie-banner" style="position:fixed;bottom:0;left:0;right:0;background:#1e293b;padding:20px;display:none;">
<p style="color:white;margin:0 0 10px 0;">
We use cookies to improve your experience.
<a href="/pages/privacy.php" style="color:#a78bfa;">Learn more</a>
</p>
<button onclick="acceptCookies()" style="background:#8b5cf6;color:white;padding:8px 16px;border:none;border-radius:4px;cursor:pointer;">
Accept
</button>
<button onclick="rejectCookies()" style="background:#475569;color:white;padding:8px 16px;border:none;border-radius:4px;cursor:pointer;margin-left:10px;">
Reject
</button>
</div>
<script>
function acceptCookies() {
localStorage.setItem('cookieConsent', 'accepted');
document.getElementById('cookie-banner').style.display = 'none';
// Load your tracking scripts here
gtag('consent', 'update', {'analytics_storage': 'granted'});
}
function rejectCookies() {
localStorage.setItem('cookieConsent', 'rejected');
document.getElementById('cookie-banner').style.display = 'none';
}
// Show banner if no choice was made
if (!localStorage.getItem('cookieConsent')) {
document.getElementById('cookie-banner').style.display = 'block';
}
</script>
Privacy compliance can be complex. If you're handling sensitive data or have a large user base, consider consulting with a privacy lawyer or data protection officer.
This guide provides general information and is not legal advice. Laws change frequently, so always verify current requirements.
Enter any two values
to calculate the third
More tools coming soon