When Boston Beer Company founder Jim Koch stood up to toast President Trump at a recent dinner, he opened with a line familiar to anyone who’s seen one of his commercials.
“I started making Sam Adams beer in my kitchen  years ago.”
It was what he said next that got him into trouble. Standing with Trump’s Bedminster golf club in the background, Koch thanked the president for a tax overhaul that he said would help him battle foreign competitors. “We’re going to kick their ass,” Koch added.
In the days since, Boston Beer has become the latest example of how tricky the landscape is for consumer brands under Trump, a deeply polarizing president whose every association has the potential to ignite a battle between his supporters and foes.
“Marketers really haven’t had to deal with something like this for 50 years — since the Vietnam War,” said Robert Passikoff, president of the New York consulting firm Brand Keys. “There is no win on this thing. There’s only dealing with it,” he added. “Now, everything is political.”
Koch and Boston Beer have faced a backlash on social media driven by figures such as Somerville Mayor Joseph A. Curtatone , who pledged in a Twitter post to “never drink Sam Adam’s beer again!” In the physical world, a Jamaica Plain teenager and his father hung a spray-painted sign within sight of the company’s Boston brewery reading, “SHAME! SAM ADAMS [heart] TRUMP SHAME!”
Another Twitter user shared an image of a smashed bottle of Sam Adams Light — a counterpoint, perhaps, to the Keurig coffeemaker owners who destroyed their machines last fall to protest the Vermont company’s decision to pull ads from Sean Hannity’s Fox News show.
Controversies like these have often dogged New England companies since Trump’s election. In 2016, New Balance found itself the unhappy subject of an ideological tug of war between right-wing extremists and anti-Trump protesters, some of whom burned their sneakers, after the company made optimistic statements about Trump’s trade policies. Wayfair and TJX Cos. both faced pressure to stop selling furnishings made by Ivanka Trump’s housewares line.
In Maine, L.L. Bean faced a boycott over a board member’s donation to Trump. And in Western Massachusetts, the owner of Dave’s Soda and Pet City said his brand had been “destroyed in one day” last fall when he attended an event where Trump rolled back part of the Affordable Care Act.
Elsewhere, Trump supporters have called out businesses for seeming hostile to the president. Some called for a boycott of Walmart this summer after discovering an “Impeach 45” T-shirt for sale on the retailer’s website. (Amid a swell of indignation on Twitter, the company swiftly removed the item.)
“Businesspeople weigh in on political issues at their peril,” said Raymond P. Howell, who was press secretary for governor William F. Weld and now advises business clients on communications. “Consumers, especially millennials, want to know that the brands they patronize share their values.”
Observers are marveling at how quickly the landscape has changed, with Trump taking power at a moment where social media has given consumers a megaphone, forcing business leaders to confront their complaints in the public square.
David F. D’Alessandro , a former chief executive of John Hancock who stepped down in 2004, saidit would have been seen by its customers as “an endorsement of the company” for him to meet with a president from either party.
“There would be no policyholders that would say, ‘We’re going to give up being a Hancock customer’ — ever. It would be seen as prestigious,” said D’Alessandro. “Now, I think there are a lot of CEOs who would dread getting an invitation.”
If the debate over Koch’s comments dies down soon, Boston Beer might have Omarosa Manigault Newman to thank. Todd Grossman, chief executive for the Americas at social media analytics firm Talkwalker Inc., said the online discussion over the company has paled in comparison to the chatter over Trump’s feud with his former aide.
One advantage to companies that find themselves at the center of the Trump tempest: In an age of diminishing attention spans, controversies tend to come and go at lightning speed. Though the online conversation around Boston Beer has been largely negative — a departure from the normally positive comments it tends to get — Grossman noted that the company’s stock price has remained stable — it’s actually gone up a bit — a signal that investors are not overly worried about sales.
“I don’t see this as a crisis for them, but I see this as something that they should continue to monitor,” he said. “It’s still more of a local story.”
Boston Beer has long placed its namesake region at the core of its story, with Koch as its main character. Past threats to boycott Sam Adams have often involved hokey regional sports rivalries in which the beer is a stand-in for Boston, with fans of opposing teams refusing to drink or sell it.
Boston Beer and Koch declined to comment.
Susan Dobscha, marketing professor at Bentley University, said Koch should be extra careful when he wades into public policy, given that he plays the role of spokesman along with his corporate position as chairman.
Koch is the company’s face in commercials and promotions, his avuncular voice extolling the Sam Adams story and its devotion to good beer (though he’s less visible in relation to other Boston Beer products such as Truly Spiked & Sparkling beverages, and Angry Orchard ciders).
“The Pillsbury Doughboy doesn’t have this problem, because he doesn’t go to dinner with Trump,” Dobscha said. Koch “made that choice when he chose to star in his own ads. Because of that, he’s got to stay in his lane.”
Koch has been a voice in the debate over taxes on beer for some time. He and Boston Beer have worked with the Brewers Association, a trade group for craft brewers, for the past decade to persuade Congress to reduce the federal excise tax for breweries.
Once pitched by a bipartisan group of lawmakers, the measure was included in the much broader GOP-endorsed tax plan that Congress passed late last year.
For companies of Boston Beer’s size, the bill reduces the excise tax to $16 a barrel from $18 a barrel. In a recent conference call with analysts, Koch said the company’s effective tax rate fell to 28 percent this summer from 36 percent a year earlier, largely because of the tax changes that Congress passed in 2017.
For other business owners who say they benefited from the tax bill, the Koch situation raises questions about whether it’s too dangerous these days to say what they think.
Michael Kane, owner of 126 Self Storage in Ashland, said he voted for Trump. He tries to keep his politics out of business, though he occasionally finds himself debating with one of his 500 tenants over immigration or taxes (he would have liked to see reform go further).
He said the outcry over Boston Beer demonstrates a tendency to shut conversation down rather than engage with people who disagree.
“It says to me more about the left than Jim Koch,” Kane said. “It’s a very scary thing that they’re doing.”Jon Chesto of the Globe staff contributed to this article. Andy Rosen can be reached at email@example.com.