Percentage of global support on Facebook for each team, colored by region: Europe North N. America South S. America Africa Asia

Which team should Brazilians support in the World Cup final? Germany, which humiliated them in the semifinals? Or Argentina, their hated rival , which could raise the trophy on Brazilian soil?

Brazil’s dilemma may be particularly painful, but it’s not unique. At some point in the last four weeks, fans of 30 of the World Cup's 32 teams have had to decide which team to adopt as a second choice. As a thought exercise, wondering who's rooting for which team is great fun. But it’s been nearly impossible to measure – until vast amounts of social-media data came along.

new analysis by Facebook’s data science team analyzed migrations of fan support from one country to another throughout the tournament, stage by stage. It’s based partly on the contents of people’s posts, which means it is largely a reflection of the views of people who follow the World Cup at least to some degree. In the chart above showing global opinion, Brazil, the U.S. and Mexico have a strong influence on the results, because of their size, Facebook population and high interest in the World Cup.

Who Rooted For Whom on Facebook During the World Cup Final

A couple of quick notes: The data is not based on “Likes,” as our maps of baseball and basketball fandom were. Instead, the data relies on a few measurements. The first comes from people’s status updates: When people said that they were watching a game, some were prompted with a choice between the flags of the two countries playing and asked to choose which they were rooting for. Other times, people posted a clear preference for one team in their status updates, like “#GoUSMNT” in support of the American team. Finally, Facebook asked some visitors on the trending World Cup Facebook page to say which team they were rooting for.

The data science team processed these responses and normalized them into a single estimate for the share of that country’s Facebook users who preferred a given team. As caveats, remember that Facebook penetration rates vary across countries and that Internet users are not necessarily representative of the general population.

Still, the data does reflect a remarkably large sample. About 300 million people around the world participated in World Cup conversations on Facebook — the highest level of conversation around a single event that Facebook has ever had, according to Dustin Cable, a data analyst at Facebook. It’s also worth noting that some of the patterns here are also evident in a study of public opinion in 19 countries that YouGov conducted for The Upshot before the World Cup.

Of course, in any individual game – like the final – rooting interest can be driven by dislike as much as favorability. As Andrew Flowers of FiveThirtyEight recently wondered , is it better to root for your next favorite country, or against a loathsome rival? Below, we show you how fans changed their rooting over the course of the tournament.

Facebook users who live in Brazil rooted for …

So who did Brazil root for in the finals? Well, it seems that “anyone but Argentina” held true as a cheering strategy — Germany received overwhelming suppport.

Facebook users who live in the United States rooted for …

Soccer may be making headway in the United States, but it’s easy to overlook how strong the support is for a different team: Mexico. Mexico has a huge fan base in the U.S. and plays many of its own national team’s games on U.S. soil. That could explain why soccer fans in the U.S. supported the two teams roughly equally in the Round of 16. In an interesting twist, support for Germany and Argentina in the final is split right down the middle.

Facebook users who live in Argentina rooted for …

Users who said they were from Argentina also tended to support other South American countries, particularly Chile, Colombia and Uruguay (even if the feeling isn't mutual ). Colombia, in particular, had a strong showing in the quarterfinals, when they were playing against Argentina’s arch-rival, Brazil. Argentines are, not surprisingly, fully behind their country in the final.

Facebook users who live in Germany rooted for …

Like the fans from the other finalist, Argentina, Germans on Facebook supported their team in increasing shares as the tournament went on, as their options for alternatives narrowed.

Facebook users who live in the Netherlands rooted for …

The Dutch chart looks similar to the one for Germany, except for the obvious difference that it stops before the final. In a way, the problem for the Dutch is similar to that of Brazil: support the team playing your biggest a rival, or hope to keep the World Cup trophy on your continent. Unlike Brazilians, the Dutch are supporting their neighbors.

Facebook users who live in Spain rooted for …

The biggest surprise of the tournament – at least, until that other one – was Spain's early exit . This presented an unexpected choice for Spanish fans, who seemed to have a hard time deciding which team to support. One clear trend was Spanish fans’ choice for South American teams over European ones: Chile in the Round of 16, then Colombia in the quarterfinals, and Argentina in the semifinals. (In the finals, however, support was split.) The Netherlands, which supplied the first warning signs for Spain, was consistently at the bottom of the Spanish fan pile.

Facebook users who live in Britain rooted for …

England, like Spain, had a surprisingly early exit from the tournament; American soccer fans may be somewhat heartened to see that many soccer fans in Britain turned to the Yanks in the Round of 16, although there was no strong favorite in the data.

Facebook users who live in Mexico rooted for …

Soccer fans in the United States couldn't seem to decide between the Yanks and Mexico. Mexican fans did not return the favor. In both the group stage and the Round of 16, only about 2 percent of Mexicans on Facebook preferred the American team. Once Mexico lost, fans supported mostly South American teams, strongly favoring Colombia in the quarterfinals and Argentina in the semifinals. In the finals, support was divided nearly 50-50 between Argentina and Germany.

Australia

Algeria

Belgium

Bosnia and Herzegovina

Cameroon

Chile

Costa Rica

Colombia

Croatia

Ecuador

France

Greece

Ghana

Honduras

Iran

Italy

Ivory Coast

Japan

Nigeria

Portugal

Russia

Switzerland

South Korea