Budweiser had a simple, noncontroversial idea for its 2017 Super Bowl ad.

The label, owned by Anheuser-Busch InBev, wanted to show itself as a “champion of the American dream,” said Ricardo Marques, a vice president at Budweiser.

That was last May. Several months later, Mr. Marques said, the company landed on the idea of telling a heartfelt story about its founder. It then spent months gathering feedback before shooting the spot in early January.

Budweiser could not have foreseen the roiling sociopolitical debate that would be unfolding when the ad aired, shortly after President Trump moved to sharply limit immigration. Nor could it anticipate the viral effect of the spot, which showed Adolphus Busch’s journey to the United States from Germany in the 1850s and the discrimination he overcame on his way to success.

“This was not something we came up with at the last minute to make any sort of political statement,” Mr. Marques said. As the conversation around immigration changed in the past month, Budweiser “didn’t consider, at any point in time, not running the ad,” he said.

“If I look at the figures now, it was for sure the right call,” Mr. Marques said, noting that the spot had garnered more than 22 million views on YouTube and that the “boycott Budweiser” hashtag that trended on Twitter on Sunday was used largely by supporters, not detractors. “We’re excited,” Mr. Marques added. “The question we’re asking ourselves is, how can we do it again next year?”

This year, Super Bowl advertisements with just a hint of political or social themes — simply showing the faces of people of different ethnicities, for instance — prompted a maelstrom of commentary on social media. But the brands that presented those ads arrived at this moment in very different ways, with different motivations.

Coca-Cola revived its 2014 Super Bowl ad, showing Americans of different ethnicities singing a multilingual version of “America the Beautiful.” Airbnb embraced the controversy surrounding Mr. Trump’s travel ban, recycling parts of a video produced last year in a last-minute spot that displayed the message, “The world is more beautiful the more you accept.” Audi entered the fray with a slightly different message, advocating equal pay for women, and 84 Lumber portrayed a Spanish-speaking mother and daughter on their way into the United States, which it knew would be politically controversial.

The outsize response to each of the ads — which were not representative of the large slate of celebrity-filled, nostalgic and funny spots that dominated the Super Bowl broadcast — was similar to the online reaction brands have experienced in recent weeks across the broader business spectrum. Silicon Valley has resisted Mr. Trump’s border policy while some department stores have discontinued Ivanka Trump’s line of merchandise.

Almost half of the time YouTube users spent watching ads on the service on Sunday was devoted to commercials tied to social and political topics, YouTube said, even though Fox and the National Football League had approval rights for ads running during the game broadcast, which kept them from being overtly political. Fox’s advertising guidelines online say that, in general, it will not sell commercial time “for viewpoint or advocacy of controversial issues.”

Audi, which started brainstorming for its ad almost a year ago, faced some blowback online for its commercial, which championed equal pay for women. Some people criticized the company for its lack of women in leadership roles. But over all, Facebook said on Monday, Audi’s ad was the most discussed Super Bowl commercial on the site; on YouTube, it passed five million views before the game began.

“Making a cultural statement on a stage as big as Super Bowl was bound to spark dialogue,” said Loren Angelo, vice president of marketing at Audi of America. “We knew this but were confident that the universal message of pay equality would resonate.”

Coca-Cola’s “America the Beautiful” ad, which ran just before the game, had a new resonance with viewers on Sunday night given the recent national conversation around immigration and inclusion, even though Coca-Cola said it had run the ad many times since its original broadcast, including during the opening ceremony of the Olympics and the football playoffs. The perception by many viewers that the ad was political was most likely not a surprise for the company. When it first aired, the performance of portions of the song in other languages offended some people.

Airbnb’s Super Bowl appearance was a hasty but pointed entry into the political fray.

The company decided just last week to run a Super Bowl ad, recycling creative work from last year, and adding the hashtag “we accept,” in what was seen as a response to Mr. Trump’s executive order to temporarily close America’s borders to all refugees and to citizens of seven predominantly Muslim countries. Brian Chesky, Airbnb’s chief executive and co-founder, told employees in a memo last month that the order was “a policy I profoundly disagree with, and it is a direct obstacle to our mission at Airbnb.”

When the Super Bowl ad aired, he posted to Twitter about Airbnb’s commitment to refugees. Airbnb’s tweet of the ad was shared more than 29,000 times.

84 Lumber, a building materials supplier based in Pennsylvania, drew attention before the game for saying it was forced to alter its plans for its first Super Bowl commercial after Fox said its depiction of a Spanish-speaking mother and daughter confronting a border wall between the United States and Mexico was “too controversial.” While the rejection was a surprise, the company used it to its benefit.

Once Fox asked for a revision, said Maggie Magerko, the company’s president and owner, “I thought I would take advantage of this, take advantage of this political environment, take advantage of Fox censoring it.”

84 Lumber — which wanted to make its name known to people 40 and under who might not be familiar with the brand, Ms. Magerko said — was rewarded with a television audience of more than 111 million. “We were not smart enough to understand the social networking impact,” she said.

Brands that considered incorporating political or social commentary into their ads watched the performance on Sunday with interest.

GoDaddy, which ran a Super Bowl ad centered on internet references, considered mentioning Mr. Trump’s Twitter posts in its commercial but decided not to because it “didn’t want to add to what is an already politically charged, divisive climate,” said Barb Rechterman, its chief marketing officer.

It remains to be seen how the chatter might translate to brand perception and, of course, sales.

“Some were really well done, like the Audi spot with the theme around gender equality,” Ms. Rechterman said of commercials that had a political or social bent. “Others may have been interesting for the journalists covering politics but may not have landed brands where they wanted to be with consumers.”