The Super Bowl marks the perfect opportunity for brands to showcase their latest big-budget commercials. Yet when faced with a divisive political environment, marketers had to choose wisely on what message they wanted to get across.

With 30-second TV spots having cost a reported $5 million each, marketers have to decide what will draw in consumers; and that could be celebrity appearances, brand-new designs or opting for a more thought-provoking tone.

Whether advertisers intended to address politics or not, some of this year’s ads were seen as touching upon areas that could be connected to current topical debates.

“It should be noted that the concept of the Super Bowl commercials is being determined and executed months before the game,” Dr. Ayalla Ruvio, assistant professor at the Department of Marketing, Broad College of Business, Michigan State University, told CNBC via email.

“Political changes, such the ones that we are currently experiencing, might shift the way the public perceived these messages. Issues that traditionally were viewed as positive and even mainstream can be challenged and become controversial.”

Since President Donald Trump was sworn-in just over two weeks ago, a raft of executive orders have been signed, including those connected to immigration, while parts of the White House website have been modified to highlight the new administration’s stance on topics like climate change.

Budweiser’s Super Bowl commercial looked at the story of the brand’s co-founder – German-born Adolphus Busch – and his pursuit of the American Dream.

During the commercial, which shows Busch’s journey from Germany to St. Louis in 1857, Busch is faced with insults such as “Go back home”. Even though the ad was released shortly after Trump’s temporary travel ban, Budweiser stated that the current political context was not the intent of the ad but rather the American Dream and the company’s heritage.

According to The Associated Press, Budweiser had been working on the ad since May, yet despite the ad’s key message; a hashtag called #BoycottBudweiser emerged on social media prior to Sunday’s Super Bowl.

Even with the mixed response, the advert garnered attention. According to Twitter, Budweiser was the fourth most-mentioned brand during the Super Bowl, while carmaker Audi – which aired an ad on gender pay – and building supplies firm 84 Lumber were in the top 10.

The first ad from 84 Lumber – which featured a border wall – was turned down by Super Bowl broadcast network Fox, Reuters reported.

According to Fox’s main advertising guidelines, the broadcaster will not sell advertising time for “viewpoint or advocacy of controversial issues” and marketers aren’t permitted to project such subjects during the airtime.

84 Lumber’s advert – which shows a Spanish-speaking mother and her daughter’s journey towards the U.S. – was edited down to not feature a wall, but told viewers to complete the journey by viewing the rest online. The full video posted online ends with the statement “The will to succeed is always welcome here.”

Even Avocados From Mexico, which avoided political commentary with a light-hearted ad about the avocado’s nutritional value, found itself being caught up in the conversation, as the future of the U.S.’ relationship with Mexico is put into question.

“When companies approach social issues that might have political connotations to them, normally (they should) do it with great caution and in a way that will echo the beliefs and concerns of the majority of their consumers, while trying to avoid controversy,” said Ruvio.

“Taking a stand on issues of concern in a positive, constructive and unifying way enable companies to build a deeper connection with their consumers and to embed their brand with added value that will be beneficial to them long after the game is over.”

Meanwhile, Chris Lehmann, managing director of Landor in San Francisco, said brands couldn’t “afford to remain neutral on social issues” which were affecting consumers’ lives.

“We live in a very politically charged environment, and customers are looking for their favorite brands to take a side on issues—hopefully one that aligns with the customer’s own values,” Lehmann told CNBC via email, adding that brands need to provide “a clear and authentic position”, to ensure their target audiences understand what the company’s core values are.

BrandSimple Consulting’s founder, Allen Adamson however said that with the political environment being so polarized in the U.S. right now, commercials “should avoid stepping into those (political) choppy waters.”

“For every consumer advertisers potentially make a connection with (when) using a political theme, they will likely alienate another,” said Adamson, adding however that the “biggest risk advertisers face on the Super Bowl is not getting noticed”, highlighting how important an advert’s message is.

With commercials having the ability to be as much of a spectacle as the game itself, Lehmann said brands had to think about targeting a broad, diverse group of consumers that may not necessarily share the same opinions.

“Alienating a large portion of your consumer base is a definite risk for brands choosing to takes sides on tricky social or political issues,” said Lehmann, adding that firms have to end up deciding whether the potential benefits of connecting with a large audience offsets the potential risks.

Follow CNBC International on Twitter and Facebook.