SAN FRANCISCO — As the world of electronic privacy law becomes increasingly difficult to navigate, a federal ruling Monday marked a start toward clarifying what data sharing is OK—and what can potentially cost a company billions.

U.S. Magistrate Judge Laurel Beeler of the Northern District of California is keeping Hulu on the hook for sharing users’ information and video preferences with Facebook Inc. But she ruled the video streaming site is not liable for sharing similar information with comScore Inc., a metrics company that analyzes Hulu’s audience.