Five Facebook users in California have settled a class action lawsuit they filed against the social media company for what they deem as unfair advertising techniques that take advantage of Facebook users.

The complainants filed the lawsuit in U.S. District Court in San Jose, claiming that Facebook violated California law by publicizing users' 'likes' for all to see without paying them or giving them an option to opt out.

Otherwise known as 'sponsored stories,' the ads in question are generated and displayed when a user's Facebook friends 'like' a particular posting or page. According to the lawsuit, this essentially amounts to free advertising for any brands being mentioned.

Facebook founder, chairman and chief executive Mark Zuckerberg is quoted in the lawsuit as saying that such friend endorsement is the 'holy grail' of advertising.

The judge in the case sided with the consumers. As a result, Facebook has agreed to give a total of $10 million to charity to settle the lawsuit. The charities that will receive the payout are unknown at this time.

The judge must still approve the final settlement.