Populous, developing countries like Vietnam are where the company is looking to add its next billion customers -- and to bolster its ad business. Facebook's promise to Vietnam helped the social media giant placate a government that had called on local companies not to advertise on foreign sites like Facebook, and it remains a major marketing channel for businesses there.
The diplomatic game that unfolded in Vietnam has become increasingly common for Facebook. The internet is Balkanizing, and the world's largest tech companies have had to dispatch envoys to, in effect, contain the damage such divisions pose to their ambitions.
The internet has long had a reputation of being an anything-goes place that only a few nations have tried to tame -- China in particular. But in recent years, events as varied as the Arab Spring, elections in France and confusion in Indonesia over the religion of the country's president have awakened governments to how they have lost some control over online speech, commerce and politics on their home turf.
Even in the United States, tech giants are facing heightened scrutiny from the government. Facebook recently cooperated with investigators for Robert S. Mueller III, the special counsel investigating Russian interference in the American presidential election. In recent weeks, politicians on the left and the right have also spoken out about the excess power of America's largest tech companies.
As nations try to grab back power online, a clash is brewing between governments and companies. Some of the biggest companies in the world -- Google, Apple, Facebook, Amazon and Alibaba among them -- are finding they need to play by an entirely new set of rules on the once-anarchic internet.
And it's not just one new set of rules. According to a review by The New York Times, more than 50 countries have passed laws over the last five years to gain greater control over how their people use the web.
''Ultimately, it's a grand power struggle,'' said David Reed, an early pioneer of the internet and a former professor at the M.I.T. Media Lab. ''Governments started waking up as soon as a significant part of their powers of communication of any sort started being invaded by companies.''
Facebook encapsulates the reasons for the internet's fragmentation -- and increasingly, its consequences.
The company has become so far-reaching that more than two billion people -- about a quarter of the world's population -- now use Facebook each month. Internet users (excluding China) spend one in five minutes online within the Facebook universe, according to comScore, a research firm. And Mark Zuckerberg, Facebook's chief executive, wants that dominance to grow.
More from The New York Times:
In China, Facebook Tests the Waters With a Stealth App
Can Facebook Fix Its Own Worst Bug?
Facebook's Zuckerberg, Bucking Tide, Takes Public Stand Against Isolationism
But politicians have struck back. China, which blocked Facebook in 2009, has resisted Mr. Zuckerberg's efforts to get the social network back into the country. In Europe, officials have repudiated Facebook's attempts to gather data from its messaging apps and third-party websites.
The Silicon Valley giant's tussle with the fracturing internet is poised to escalate. Facebook has now reached almost everyone who already has some form of internet access, excluding China. Capturing those last users -- including in Asian nations like Vietnam and African countries like Kenya -- may involve more government roadblocks.
''We understand that and accept that our ideals are not everyone's,'' said Elliot Schrage, Facebook's vice president of communications and public policy. ''But when you look at the data and truly listen to the people around the world who rely on our service, it's clear that we do a much better job of bringing people together than polarizing them.''
By mid-2016, a yearslong campaign by Facebook to get into China -- the world's biggest internet market -- appeared to be sputtering.
Mr. Zuckerberg had wined and dined Chinese politicians, publicly showed off his newly acquired Chinese-language skills -- a moment that set the internet abuzz -- and talked with a potential Chinese partner about pushing the social network into the market, according to a person familiar with the talks who declined to be named because the discussions were confidential.
At a White House dinner in 2015, Mr. Zuckerberg had even asked the Chinese president, Xi Jinping, whether Mr. Xi might offer a Chinese name for his soon-to-be-born first child -- usually a privilege reserved for older relatives, or sometimes a fortune teller. Mr. Xi declined, according to a person briefed on the matter.
But all those efforts flopped, foiling Facebook's attempts to crack one of the most isolated pockets of the internet.
China has blocked Facebook and Twitter since mid-2009, after an outbreak of ethnic rioting in the western part of the country. In recent years, similar barriers have gone up for Google services and other apps, like Line and Instagram.
Even if Facebook found a way to enter China now, it would not guarantee financial success. Today, the overwhelming majority of Chinese citizens use local online services like Qihoo 360 and Sina Weibo. No American-made apps rank among China's 50 most popular services, according to SAMPi, a market research firm.
Chinese tech officials said that although many in the government are open to the idea of Facebook releasing products in China, there is resistance among leaders in the standing committee of the country's Politburo, its top decision-making body.
In 2016, Facebook took tentative steps toward embracing China's censorship policies. That summer, Facebook developed a tool that could suppress posts in certain geographic areas, The Times reported last year. The idea was that it would help the company get into China by enabling Facebook or a local partner to censor content according to Beijing's demands. The tool was not deployed.
In another push last year, Mr. Zuckerberg spent time at a conference in Beijing that is a standard on the China government relations tour. Using his characteristic brand of diplomacy -- the Facebook status update -- he posted a photo of himself running in Tiananmen Square on a dangerously smoggy day. The photo drew derision on Twitter, and concerns from Chinese about Mr. Zuckerberg's health.
For all the courtship, things never quite worked out.
''There's an interest on both sides of the dance, so some kind of product can be introduced,'' said Kai-Fu Lee, the former head of Google in China who now runs a venture-capital firm in Beijing. ''But what Facebook wants is impossible, and what they can have may not be very meaningful.''
This spring, Facebook tried a different tactic: testing the waters in China without telling anyone. The company authorized the release of a photo-sharing app there that does not bear its name, and experimented by linking it to a Chinese social network called WeChat.
One factor driving Mr. Zuckerberg may be the brisk ad business that Facebook does from its Hong Kong offices, where the company helps Chinese companies -- and the government's own propaganda organs -- spread their messages. In fact, the scale of the Chinese government's use of Facebook to communicate abroad offers a notable sign of Beijing's understanding of Facebook's power to mold public opinion.
Chinese state media outlets have used ad buys to spread propaganda around key diplomatic events. Its stodgy state-run television station and the party mouthpiece newspaper each have far more Facebook ''likes'' than popular Western news brands like CNN and Fox News, a likely indication of big ad buys.
To attract more ad spending, Facebook set up one page to show China's state broadcaster, CCTV, how to promote on the platform, according to a person familiar with the matter. Dedicated to Mr. Xi's international trips, the page is still regularly updated by CCTV, and has 2.7 million likes. During the 2015 trip when Mr. Xi met Mr. Zuckerberg, CCTV used the channel to spread positive stories. One post was titled ''Xi's UN address wins warm applause.''
Fittingly, Mr. Zuckerberg's eagerness and China's reluctance can be tracked on Facebook.
During Mr. Xi's 2015 trip to America, Mr. Zuckerberg posted about how the visit offered him his first chance to speak a foreign language with a world leader. The post got more than a half million likes, including from Chinese state media (despite the national ban). But on Mr. Xi's propaganda page, Mr. Zuckerberg got only one mention -- in a list of the many tech executives who met the Chinese president.
Europe's privacy pushback
Last summer, emails winged back and forth between members of Facebook's global policy team. They were finalizing plans, more than two years in the making, for WhatsApp, the messaging app Facebook had bought in 2014, to start sharing data on its one billion users with its new parent company. The company planned to use the data to tailor ads on Facebook's other services and to stop spam on WhatsApp.
A big issue: how to win over wary regulators around the world.
Despite all that planning, Facebook was hit by a major backlash. A month after the new data-sharing deal started in August 2016, German privacy officials ordered WhatsApp to stop passing data on its 36 million local users to Facebook, claiming people did not have enough say over how it would be used. The British privacy watchdog soon followed.
By late October, all 28 of Europe's national data-protection authorities jointly called on Facebook to stop the practice. Facebook quietly mothballed its plans in Europe. It has continued to collect people's information elsewhere, including the United States.
''There's a growing awareness that people's data is controlled by large American actors,'' said Isabelle Falque-Pierrotin, France's privacy regulator. ''These actors now know that times have changed.''
Facebook's retreat shows how Europe is effectively employing regulations -- including tough privacy rules -- to control how parts of the internet are run.