Companies love analytics, but customers value privacy. Recent legislation such as Europe's General Data Protection Regulation (GDPR) and the California Consumer Privacy Act (CCPA) in the USA aim to restrict the ways that web developers can legally track visitors. We'll learn how to achieve basic compliance with these regulations using contributed modules for Drupal 7, 8, and 9, and I'll show you how to achieve strict compliance by writing Drupal Behaviors in a custom module.