Television maker Vizio and a subsidiary were recently charged with secretly tracking people’s viewing habits and selling viewing data from millions of TVs without the knowledge or consent of the sets’ owners. The data was then used by marketing companies and data brokers for a range of things, including measuring how effective ad campaigns were and whether people watched them.

The “defendant’s smart televisions collect personally identifying information … through its Smart Interactivity software, and then disclose this private information to third parties, such as advertisers or data brokers,” according to the class-action lawsuit, filed Thursday in the U.S. District Court here.

While the tracking features could be turned off, the issue is that the majority of Vizio Smart TVs had the featured turn on by default instead of using an opt-in setting. (Newer Vizio TVs that run the company’s SmartCast system have the tracking turned off by default).

The TVs tracked what people watched on a second-by-second basis, regardless of the video source, according to the FTC. The data was then paired with demographic details such as “sex, age, income, marital status, household size, education, home ownership, and household value.” The data wasn’t linked to specific individuals, so while companies had demographic data, they didn’t have a specific name that the data paired with.

As Lesley Fair, a senior attorney with the FTC’s consumer protection bureau, puts it in a blog post, “Vizio then turned that mountain of data into cash by selling consumers’ viewing histories to advertisers and others. And let’s be clear: We’re not talking about summary information about national viewing trends. According to the complaint, Vizio got personal.”

The charges were brought by the FTC and and the New Jersey attorney general’s office. As part of the $2.2 million payment by Vizio, $1.5 million will go to the FTC and $1 million to the New Jersey Division of Consumer Affairs. ($300,000 of that amount will be suspended by the state if Vizio complies with the agreement).