Advertisers would collect the bulk of the money after alleging Facebook inflated the average time users viewed video on the platform.

On Friday, several advertising agencies revealed the details of a proposed settlement with Facebook that would end a class action alleging the social media giant overstated the average time its users spent watching video.

According to a brief in support of the settlement, Facebook would pay $40 million to resolve claims. Much of that would go to those who purchased ad time in videos, though $12 million — or 30 percent of the settlement fund — is earmarked for plaintiffs' attorneys.

The suit accused Facebook of acknowledging miscalculations in metrics upon press reports, but still not taking responsibility for the breadth of the problem. "The average viewership metrics were not inflated by only 60%-80%; they were inflated by some 150 to 900%," stated an amended complaint.

Faced with claims of violating unfair competition law, breaching contract and committing fraud, Facebook contested advertisers' injuries, questioning whether they really relied on these metrics in deciding to purchase ad time. In early rounds in the litigation, Facebook was successful in getting the judge to pare the claims, though until a settlement was announced, several of the claims including fraud were still live. Even after agreeing to pay $40 million for settlement, Facebook maintains the suit is "without merit."

The plaintiffs estimate that had they gone to trial, they may have recovered between $100 million and $200 million in damages, though they also stress to U.S. District Court Judge Jeffrey White the uncertainty of this result as well as the expensive process. The judge will decide on approval after examining the fairness of the pact.

Here's the full memorandum in support of the settlement.