A technical guide to privacy compliance in user behavior analytics: GDPR data minimization and consent requirements, China's PIPL key obligations, Security Level Protection 2.0 audit requirements, IP hashing and userId HMAC implementation, and opt-out / DNT signal handling.