WASHINGTON (Reuters) – Two U.S. senators introduced a bill on Tuesday to ban online social media companies like Facebook Inc and Twitter Inc from tricking consumers into giving up their personal data.

The bill from Mark Warner, a Democrat, and Deb Fischer, a Republican, would also ban online platforms with more than 100 million monthly active users from designing addicting games or other websites for children under age 13.

The bill takes aim at practices that online platforms use to mislead people into giving personal data to companies or otherwise trick them. The so-called “dark patterns” were developed using behavioural psychology.

“Misleading prompts to just click the ‘OK’ button can often transfer your contacts, messages, browsing activity, photos, or location information without you even realizing it,” Fischer said in a statement issued by both senators.

Restrictions on how social media companies collect information about users could hurt their ability to sell advertisements, a key source of profit.

A website aimed at tracking dark patterns identifies behaviour, such as a website or app showing that a user has new notifications when they do not.

Warner said in an interview on CNBC that the legislation could be included in a federal privacy bill that lawmakers in the Senate Commerce Committee are drafting. Congress has been expected to take up privacy legislation after California passed a strict privacy law that goes into effect next year.

“The platform companies are now going to have an opportunity to put their money where their mouth is, to see if they support this legislation and other approaches,” he said.

The bill would bar companies from choosing groups of people for behavioural experiments unless the companies get informed consent.

Under the terms of the bill, social media companies would create a professional standards body to create best practices to deal with the issue. The Federal Trade Commission, which investigates deceptive advertising, would work with the group.

Facebook, Google, Twitter and other free online services relay on advertising for revenue, and use data collected on users to more effectively target those ads.