David Whitaker posed as an agent for online drug dealers in dozens of recorded phone calls and email exchanges with Google sales executives. This was to spend $200,000 in government money for ads selling narcotics, steroids, and other controlled substances.

A federal prisoner and convicted con artist, Mr. Whitaker, was the lead actor in a government sting targeting Google Inc.

“There was a part of me that felt bad,” Mr. Whitaker wrote in his account of the undercover operation viewed by The Wall Street Journal. “I had grown to like these people.” But, he said, “I took ease in knowing they…knew it was wrong.”