Some consolidation is afoot in the world of advertising. Taboola and Outbrain, rivals that both operate advertising-based content recommendation engines for publishers — which typically appear in the form of boxes at the bottom of articles online that feature a mix of stories from the publications themselves, plus ads and sponsored content from other sites — are forming a single company.

The aim: to bulk up to a customer list that will now number 20,000 online properties and an audience of 2.6 billion to compete better against the likes of Facebook and Google, online advertising giants that present the biggest competitive threat to both adtech startups and the publishers that are Taboola and Outbrain’s customers.

The two companies, both founded out of Israel but headquartered in New York, describe the deal as a merger, but the combined entity will be called Taboola, with Taboola’s founder Adam Singolda securing the CEO slot. Further, Taboola is paying Outbrain investors $250 million in cash plus a 30% share of the combined companies. The merger is creating a company that will be valued at $2 billion, making the transaction value of this deal $850 million.

Singolda said in an interview that each of them is already profitable and each was already clearing $1 billion in revenues annually. Taboola had individually passed a $1 billion valuation years ago. (Taboola had raised $160 million from investors that include Comcast, Fidelity and Pitango; Outbrain had raised $194 million, with investors including Index, HarbourVest and Lightspeed.)

The deal is literally years in the making. Reports of talks between the two go back as far as 2015, but Singolda said they have actually been talking for the better part of a decade. (Outbrain was founded in 2006, Taboola was founded in 2007.)

The reason it’s taken so long was down to ironing out the details and getting longtime rivals to trust each other.

“It took time to build trust and to get to know each other,” Singolda said. “We needed more time to get to where we are now.”

The reason it finally happened was the existence of a collective threat. “Definitely the pressure of Google and Facebook, and the opportunity to give them a proper fight by increasing our reach was important to us.”

Between Taboola and Outbrain, the companies now have ties to a list of the biggest online media properties around today — with the combined group now working with CNBC, NBC News, USA TODAY, BILD, Sankei, Huffington Post, Microsoft, Business Insider, The Independent, El Mundo, Le Figaro, CNN, BBC, The Washington Post, The Guardian, Spiegel Online, El País and Sky News.

Taboola and Outbrain have positioned themselves as something of the last chance saloon for media companies that have continued to base all or at least some part of their business models on advertising.

In that context, the combined audience scale that Taboola and Outbrain will now have gives them the kind of leverage they believe could help these publishers continue making ad revenues on their own sites, and off the networks of companies like Google, Facebook and Amazon.

Today, these three collectively account for some 70% of all online advertising revenues, and, importantly, a large part of the traffic that leads to that revenue is coming on the networks of the companies themselves, through features like search or YouTube (on Google) and Facebook’s news feed. (And that’s a list that Facebook is going to try to extend later this month when it launches its news tab to create an even more dedicated space to news on Facebook itself.)

Taboola and Outbrain’s basic advertising building block, on the other hand, are the widgets that it runs at the bottom of articles on publishers’ own sites, putting the focus back on building and monetizing their traffic there. You could argue that this is a rock and hard place for publishers, of course: if Facebook et al. are threatening to cannibalise publishers’ revenues at every turn, Taboola et al. threaten to degrade their message and tone (these boxes are notorious for peddling spammy links, and both publishers and readers have to be aggressive in monitoring that to avoid them).

Although there is a lot that is similar between Taboola and Outbrain, there are differences that will potentially create a company that will continue expanding into other areas.

For example, Outbrain acquired a company in 2017 called Zemanta that has given it a foothold in programmatic advertising, while Taboola has made moves to expand into video inventory to better compete with the force of YouTube in video advertising.

“We will have lot of work ahead merging the products and we have big competition ahead of us,” Singolda said. “But we have no choice. These are big companies and we have to give them a fight.”

Looking ahead, Singolda said that after the task of integration is underway — which will include not just bringing together technology, but thousands of employees — it will think about what steps to take next. That could include considering a public listing, or raising more money as a private company. Because it’s currently profitable with cash in the bank, Taboola will have some time before it needs to make any decisions.

In addition to Singolda taking the CEO role, there are some other executive shifts. Eldad Maniv, president and COO of Taboola and David Kostman, co-CEO of Outbrain, are not being given any executive titles at the new company yet, but will help with the transition. Yaron Galai — who had been the CEO of Outbrain — “will remain committed to the success of the combined company, and actively assist with the transition for the 12 months following the closing.”