Facebook and Zynga have defeated class-action lawsuits accusing the companies of civil wiretapping allegations connected to advertising practices.

The Ninth US Circuit Court of Appeals, in a joint opinion filed last week on the two lawsuits [PDF], ruled the advertising practices at issue did not involve wiretapping. The San Francisco-based appeals court, however, reinstated allegations that Facebook violated its terms of service for its users, which now number about 1.2 billion.

The case concerned allegations that, when advertisements on Facebook and Zynga games like Farmville were clicked on the social network, the Facebook page addresses and Facebook IDs were collected and disclosed to advertisers without permission. But that did not amount to wiretapping under the Electronic Communications Privacy Act (ECPA), which makes it illegal to disclose "contents" of a communication, the appeals court ruled.

The federal appeals court's decision is in line with US District Judge James Ware of California, who in 2011 tossed the wiretapping allegations because the "referer" headers linked users and advertisers but did not store or process any data.

"Because information disclosed in the referer headers at issue here is not the contents of a communication as defined in ECPA, the plaintiffs cannot state a claim under those statutes," appeals Judge Sandra Ikuta said in a 22-page decision Thursday.

Ikuta wrote that "the referer header information at issue here includes only basic identification and address information, not a search term or similar communication made by the user, and therefore does not constitute the contents of a communication."

Facebook has said the advertising practice at issue has been stopped.

The company has faced a slew of privacy suits over the years, including a settlement over privacy allegations with the Federal Trade Commission in 2011. Under the deal, the FTC will audit Facebook's privacy practices for 20 years.