Google parent Alphabet shares touched a record $1,080 before slipping into the red to close the day at $1,063.29. Facebook traded as high as $184.25, then closed down slightly at $182.42.

The recent records have come despite a wave of revelations showing that both companies cannot effectively police all the content and ads on their services.

In November alone, the firms have taken down problematic content or advertising on several occasions only after being alerted by news organizations.

For Facebook, that content has included pages or posts and housing ads that discriminated based on race.

YouTube also hosted opioid marketing and replete with comments from pedophiles.

YouTube said in a statement that in the past week it had removed 150,000 videos, turned off comments on 625,000 and removed ads from "nearly 2 million."

These recent stories follow the discovery earlier this year that Russian propagandists used the services of both companies to meddle in the 2016 U.S. election.

So why the disconnect between negative headlines and record stock prices? If Facebook and Google are failing consistently at keeping users away from harmful content, why are investors so bullish on their prospects?

Because the same massive reach and targeting technology that can be used to target racist landlords or opioid users can also help legitimate online marketers find consumers ready to buy everything from shampoo to cars.

Thanks to that advertising demand, sales at both companies are expected to surge this year, supporting their bull runs.

Alphabet sales are expected to climb 22 percent to $110 billion in 2017, while Facebook revenue is seen rising 45 percent to $40 billion, based on the estimates of stock analysts surveyed by Thomson Reuters.

That growth has powered both stocks higher, outpacing the gains of the broader market for tech stocks.

Facebook shares have risen almost 60 percent this year, while those of Google parent Alphabet just over 30 percent, while the Nasdaq Composite Index is up 28 percent.