Uncovering and explaining how our digital world is changing — and changing us.

Facebook has been through one public relations disaster after another over the past 18 months.

First, we learned that Facebook was weaponized by Russia to try and sway the 2016 election. Then it was revealed that Facebook failed to protect the private user data of tens of millions of people. Then there were more privacy issues. And more privacy issues.

Most recently, CEO Mark Zuckerberg used Holocaust denial as an example of a controversial opinion that deserves a place on Facebook’s service, in defense of its stance to allow a variety of information — however wrong — to live on its platform.

But, as it turns out, if you are Wall Street at least, none of these screwups seem to matter. With its stock at an all-time high, the social media giant looks invincible.

There are two simple, measurable ways that Facebook could have been punished for all of its stumbles these past 18 months:

Advertisers could have taken their business elsewhere, hurting Facebook’s bottom line. People could have left the service and spent their time elsewhere, cutting Facebook’s ad load and hurting Facebook’s bottom line.

So far, neither of those things have happened.

In Facebook’s first quarter, reported in April, it said that it had added more daily active users during the quarter than it had during any of the three quarters prior. Its revenue grew by an impressive 49 percent almost a year after Facebook warned analysts that its revenue growth would slow “meaningfully.”

It didn’t and it hasn’t. And when Facebook reports second-quarter results on Wednesday, analysts are expecting — you guessed it — yet another great quarter.

“Despite all the negative headlines, we believe ad revenue should continue to drive very healthy growth,” wrote SunTrust’s Youssef Squali. Analysts think Facebook revenue will grow 43 percent over the same quarter one year ago.

So why are advertisers and Facebook users sticking around if everyone is angry at Facebook?

The advertiser one is probably easiest to explain: There’s simply nowhere else to go.

For years now, advertisers have been looking for a digital alternative to Facebook and Google, which completely dominate the digital advertising market. While there are other options, including Twitter and Snapchat and Oath, none come close to the scale and targeting options that Facebook provides. While advertisers may not agree with everything Facebook does or Zuckerberg says, its advertising business is too valuable for people to give up.

Facebook users are in a similar situation. While Facebook claims that it has many competitors, it’s tough to nail down who truly rivals its powerful suite of consumer apps. You could post photos to Twitter, or communicate via iMessage or traditional text, but Facebook’s stable of apps, including Instagram, WhatsApp, Facebook and Messenger, are all in the top 11 free apps in the App Store. (Google, with three of the top 11, and only one of them a communication app, is the only close rival.)

It’s possible that Facebook’s stumbles will catch up with the company eventually. U.S. officials have been all over the company in an effort to increase regulation, though nothing is imminent. Regulators in the U.K. fined Facebook earlier this month for its role in the Cambridge Analytica privacy scandal, though the $664,000 fine is laughable for a company of Facebook’s size. (That said, the European Union has shown that it’s not afraid to deliver a heftier fine, as we saw with Google earlier this month.)

The most concerning trend, if you’re Facebook, is the fact that teenagers don’t seem as interested in the social network as they used to be. And missing the next wave of internet users — the generation that literally grew up with smartphones in their hands — is a scary possibility.

But the good news if you’re Facebook: Teens still love Instagram.

The past 18 months have shown that Facebook has a lot more work to do than anyone thought. They have also shown just how dominant Facebook has become.

The company will report second-quarter earnings on Wednesday after markets close.

Sign up for the newsletter Recode Daily Email (required) By signing up, you agree to our Privacy Notice and European users agree to the data transfer policy. Subscribe