David Whitaker, a federal prisoner and convicted con artist, who posed as an agent for online drug dealers in dozens of recorded phone calls and email exchanges with Google sales executives to spend $200,000 in government money for advertisement selling narcotics, steroids, and other controlled substances has made Google lose millions.

Mr. Whitaker was the lead actor in a government sting that targeted 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.”