# GDPR Compliant Optional Tracking Button A lightweight, user-friendly JavaScript solution for implementing GDPR-compliant optional tracking on websites. By default, only minimal tracking is enabled, and users can opt-in to enhanced tracking with a fun "Plz trac me!" button. ## Features - 🔒 **GDPR Compliant by Default**: Minimal tracking until user consents - 🎨 **Beautiful UI**: Gradient button with hover effects and smooth animations - 📱 **Mobile Responsive**: Works perfectly on all device sizes - ⚡ **Lightweight**: Pure vanilla JavaScript, no dependencies - 🔧 **Easy Integration**: Drop-in solution for any website - 🍪 **Cookie Management**: Automatic cleanup when tracking is disabled - 📊 **Analytics Ready**: Google Analytics consent mode integration ## Demo Open `gdpr-tracking-consent.html` in your browser to see the button in action! ## Quick Start ### Option 1: Standalone HTML (Recommended for testing) ```html ``` ### Option 2: Minified Snippet (Production ready) ```html
``` ## How It Works ### Default State (GDPR Compliant) - Only essential cookies are allowed - Basic analytics with anonymized IP - No personalization or ad tracking - No cross-site tracking ### Enhanced Tracking (User Opt-in) - Detailed page interactions - User preferences for personalization - Marketing campaign effectiveness - Full Google Analytics features ## Integration Examples ### WordPress ```php // Add to functions.php function add_gdpr_tracking_consent() { // Include the snippet } add_action('wp_footer', 'add_gdpr_tracking_consent'); ``` ### React ```jsx import GDPRTrackingConsent from './GDPRTrackingConsent'; function App() { return (