Google's practice of serving ads based on the content of Gmail messages has long been controversial

Google will no longer scan the email messages of students who use its Google Apps for Education suite, exempting about 30 million users from the controversial Gmail advertising practice.

Apps for Education is used by students at all levels, from kindergarten to university, so a portion of the user base is made up of minors.

"We've permanently removed all ads scanning in Gmail for Apps for Education, which means Google cannot collect or use student data in Apps for Education services for advertising purposes," wrote Bram Bout, director of Google for Education, in a blog post.

Google rivals like Microsoft, as well as privacy advocates, have long criticized the company for scanning Gmail messages and serving ads to users based on the content of the emails.

The company is also facing at least one lawsuit challenging the practice. In the case "Google Inc. Gmail Litigation," number 5:13-md-002430, being heard in U.S. District Court in San Jose, California, several plaintiffs allege that by scanning the content of their Gmail messages, Google violated wiretapping laws and breached their privacy.

Asked for comment, a Google spokeswoman said that the decision announced Wednesday wasn't prompted by the lawsuit. "From day one, we turned off ads by default in Apps for Education services. The changes announced are just a continued evolution of our efforts to provide the best experience for our users, including students," she said via email.

An industry analyst has a different take. "Google was under intense pressure to stop this activity and they yielded to the pressure," said Gartner analyst Tom Austin via email. "They had a problem of appearances and did the right thing."

Google is also removing the option for Apps for Education administrators to allow ads to be shown to their users. Until now, ads were turned off by default, but admins could turn them on at their discretion.

"We're also making similar changes for all our Google Apps customers, including Business, Government and for legacy users of the free version, and we'll provide an update when the rollout is complete," Bout wrote.

Another change announced affects education users running AdSense ads on sites created with the Google Sites Web builder service. These users will retain the ability to display existing ads on their websites but will no longer be able to create new ads.

Google will hold a Hangout on Air session on Thursday at 9 a.m. U.S. Pacific Time to discuss this announcement. Participants will include Bout; Jonathan Rochelle, director of Product Management for Docs and Drive; and Apps for Education customer Hank Thiele, CTO for Maine Township High School District 207 in Park Ridge, Illinois.

"We'll be discussing these changes and answering your questions. We look forward to hearing from you," Bout wrote.

Google will continue to scan messages in its consumer Gmail version and serve up ads based on their content.

Google will also continue scanning Gmail messages in the consumer version and in Google Apps for non-advertising purposes, such as security and overall productivity, the spokeswoman said.

"In Gmail for Google Apps for Education, this includes virus and spam protection, spell check, relevant search results and features like Priority Inbox and auto-detection of calendar events. Scanning to provide product features is done on all incoming emails and is 100% automated," she said.