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. The difference boils down to how individual viewers were identified and whether those identifiers are personal enough to constitute a violation under the Video Privacy Protection Act.