Alphabet's Google will stop giving advertisers the ability to target election ads using data such as public voter records and general political affiliations, the company said in a blog post on Wednesday.

Google said it would start limiting audience targeting for election ads to age, gender and general location at a postal code level. Previously, verified political advertisers could also target ads using political affiliations such as left-leaning, right-leaning, or independent.

Social media platforms have come under fire in recent weeks over their handling of political advertising. Facebook Inc has been criticized by lawmakers and regulators over its decision to not fact-check ads run by politicians on its platform.

Google said political advertisers can still do contextual targeting, such as serving ads to people reading a certain story or watching a particular video.

The company will begin enforcing the new approach in the United Kingdom within a week, ahead of the country's general election on Dec. 12. It said it would begin enforcing it in the European Union by the end of the year and in the rest of the world starting on Jan. 6, 2020.