Google will no longer scan your Gmail messages to sell targeted advertisements, putting an end to a practice that has long troubled privacy watchdogs.

Previously, Gmail would look for keywords in your emails and show related text advertisements around the screen. For instance, if you emailed a friend about needing a marketing consultant, ads for books on marketing or a site with a list of small business vendors might appear.

Now, Gmail's 1.2 billion users will instead see advertisements based on their settings, the company said in a blog post on Friday. Customers also have the option to disable the advertising personalization in their settings.

Logo of US multinational technology company Google in Veryou. Loic Venance / AFP - Getty Images

Related: Who's Behind the Gmail Phishing Attack?

The change comes as Google is trying to attract more enterprise customers to its G Suite product, which competes with Microsoft.

"This decision brings Gmail ads in line with how we personalize ads for other Google products," Diane Greene, Google's senior vice president of cloud services said in the blog post. "Ads shown are based on users’ settings. Users can change those settings at any time, including disabling ads personalization. G Suite will continue to be ad free."

Of course, you'll still likely have the same sense that Google knows you a little too well. While Google will no longer scan your email to sell advertisements, you can still expect "smart functions "to continue.

That means when you have a dinner reservation in your email, Google will still make suggestions about where that is on the map.