By Shayndi Raice 

One of the best years ever for mergers and acquisitions could have been even better.

After years of sluggish activity, the M&A market shifted into high gear in 2014. There were $3.4 trillion of deals struck globally, up about 30% from the prior year, according to Dealogic. That's the largest total since 2007.

It was also a banner year for attempted deals that foundered, as a government crackdown on a popular tax-driven merger strategy and other factors weighed on the market. The value of takeover proposals that were rejected or withdrawn totaled more than $570 billion in 2014, more than double the prior year's total and the second-highest tally on record after 2008.

The two largest attempted deals of the year-- Pfizer Inc.'s roughly $120 billion bid for British drug company AstraZeneca PLC and 21st Century Fox Inc.'s effort to buy Time Warner Inc. for $80 billion--were consigned to the M&A scrap heap after the bids were rejected and the suitors walked away.

AbbVie Inc., meanwhile, pulled the plug on its agreement to buy Dublin-based drug maker Shire PLC for $54 billion after the U.S. government announced a set of rules aimed at making the deal and other so-called tax inversions unattractive for companies attempting them.

If those and other abortive takeover efforts had come to fruition, it would have pushed last year's deal value to about $4 trillion, making 2014 the second-best year on record for M&A, outpacing the $3.7 trillion of deals signed in 2006. The 2014 tally is still the third-highest on record.

While a number of ingredients for global deal making fell into place in 2014, there were formidable obstacles too.

Inversion deals became popular in 2014. They involve a U.S. business buying a company in a lower-tax country so it can switch its legal home and cut its tax bills. The strategy particularly appealed to pharmaceutical companies, whose overseas sales generate significant income that can't be brought back to the U.S. without the company taking a tax hit.

In September, however, the U.S. Treasury issued rules that make such deals less attractive financially. AbbVie cited those rules in abandoning its deal with Shire. AstraZeneca officials pointed to the potential for political resistance as one its reasons for turning away Pfizer's repeated takeover approaches before the U.S. drug giant gave up on the effort.

The eurozone, meanwhile, registered annualized growth of just 0.6% in the third quarter of 2014 as it continued to grapple with the aftereffects of the financial crisis. Gross domestic product in the region remained more than 2% below where it was when the global financial crisis hit in 2008.

When companies are uncertain about the future of the economies in which they operate, buyers and sellers have a harder time agreeing on price and other terms, bankers say.

"Where there's uncertainty, the buyers rightly have a cautious view of the future, whereas sellers still have rosy prospects," said Matthew Ponsonby, head of M&A in the European region at Barclays PLC.

That helps explain why Europe, the Middle East and Africa, known as EMEA, accounted for more than half the value of abandoned deals in 2014, according to Dealogic. EMEA deal volume lagged the global pace, growing 15% to $972 billion.

There were more than $300 billion of withdrawn or rejected mergers in the region last year, more than triple last year's tally and the highest total since 2008. Both the AstraZenenca and Shire deals would have been considered European because the target company was located in Europe.

Some bankers see a silver lining in all the failed deal attempts. The fact that companies are contemplating such moves is a sign that chief executives and boards once again have an appetite for large-scale M&A, they say.

There's "a healthy level of strategic dialogue taking place in many important industries," said François-Xavier de Mallmann, the global co-head of consumer, retail and health-care investment banking at Goldman Sachs Group Inc. in London.

Potential deals that stumbled because of differences between the parties on price and other matters included SABMiller PLC's overture to Heineken NV, which has a market capitalization of EUR34 billion ($41 billion). The Dutch brewer rejected the approach, saying in September that it was "nonactionable." It didn't elaborate.

In October, France's Iliad SA walked away from a bid for control of T-Mobile US Inc., saying the wireless carrier's parent, Deutsche Telekom AG, wasn't interested in the offer.

Political issues also chilled the M&A environment. Pfizer's approach to AstraZeneca, for example, came under heavy scrutiny from the British government, which was fearful of the impact on jobs.

There would have been an even bigger broken-deals tally if another effort hadn't failed before it became public. U.K. mining giant Rio Tinto PLC, with a market value of GBP56 billion ($87 billion), rebuffed a takeover approach from Glencore PLC this summer. Rio Tinto rejected the offer because it didn't include a premium, a person familiar with the matter has said.

Access Investor Kit for Rio Tinto Ltd.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=AU000000RIO1

Access Investor Kit for Deutsche Telekom AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=DE0005557508

Access Investor Kit for Iliad SA

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=FR0004035913

Access Investor Kit for SABMiller Plc

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=GB0004835483

Access Investor Kit for Barclays Plc

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=GB0031348658

Access Investor Kit for Barclays Plc

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US06738E2046

Access Investor Kit for Deutsche Telekom AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US2515661054

Access Investor Kit for The Goldman Sachs Group, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US38141G1040

Access Investor Kit for Iliad SA

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US45173Y1010

Access Investor Kit for Pfizer Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US7170811035

Access Investor Kit for SABMiller Plc

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US78572M1053

Access Investor Kit for Time Warner, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US8873173038

Access Investor Kit for 21st Century Fox, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US90130A1016

Access Investor Kit for 21st Century Fox, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US90130A2006

Subscribe to WSJ: http://online.wsj.com?mod=djnwires