By ERIC PFANNER Published: June 29, 2009 CANNES, France — Advertising agencies and Internet companies once viewed each other as foes, but are now coming together to harness the potential for online advertising. Like many other segments, online ad spending has slowed from its previous breakneck pace during the deep recession, forcing companies to devise new ways to chase fewer dollars.

Last week, Eric E. Schmidt, the chief executive of Google, and Steven A. Ballmer, his counterpart at Microsoft, for the first time attended an annual advertising industry meeting, the Cannes Lions International Advertising Festival. With consumers spending more and more time online, analysts say Internet companies and ad agencies have no choice but to work together to develop ways to make money from digital media. “There was an air of inevitability about it, because of the model not really working yet, and there’s so much content that will be dependent on it working,” said Paul Kemp-Robertson, editor of Contagious, an online magazine that tracks digital marketing trends. Microsoft and Google, along with rivals like Yahoo and AOL, are looking for growth from new kinds of ads, including online video spots. But they need advertising agencies to persuade their clients to embrace these formats.

Many companies are preferring to place ads linked to search engine results, whose effectiveness can be directly measured. Microsoft made it clear that it wanted to cooperate, announcing partnerships with two leading advertising companies, WPP Group and Publicis Groupe. Yet Mr. Ballmer expressed skepticism about the extent to which advertising could be used to finance an explosion of online content. Advertising agencies have long been big customers of Google, Microsoft and other Internet companies, shifting an increasing portion of ad budgets online.

WPP Group, the largest ad agency owner, spends $850 million a year of its clients’ money with Google, according to Martin Sorrell, WPP’s chief executive. Ninety-eight percent of Google’s revenue comes from advertising, largely from “sponsored links” that appear alongside its search results. Mr. Sorrell once called Google a “frenemy” of the ad industry, a characterization that reflected the Internet giant’s efforts to move into businesses like media buying, which in the past have been controlled by the likes of WPP. Agency executives also complained that Google remained aloof, spending hardly anything on advertising itself. Asked during an onstage interview with Maurice Lévy, chief executive of Publicis, whether he even liked advertising, Mr. Schmidt insisted: “We love advertising.” Microsoft, minus its chief executive, has been a prominent participant at the ad festival for several years, bringing hundreds of employees to the event. It is also a big advertiser, spending $700 million a year, according to Mr. Ballmer. But the breadth of its ambitions — in addition to buying and selling ads, the company owns an agency that creates them — has also caused alarm in some advertising quarters.

Analysts say the rivalry between Microsoft and Google may also play into their overtures to the ad industry. While Google has dominated the search business, Microsoft introduced a new search engine, Bing, last month. It has lifted Microsoft’s share of online searches in the United States to about 12 percent, according to ComScore, a research firm, from 8 percent for Microsoft’s previous engine. Mr. Schmidt acknowledged that Google had, in recent months, found itself in the unfamiliar position of stumbling on certain projects, including efforts to develop systems for selling newspaper and radio advertising. He said marketers were also lowering their bids for keywords on Google’s search engine, where ads are sold through online auctions.

Google has also struggled to generate significant advertising from YouTube, its online video-sharing service. Mr. Schmidt said he had high hopes for new kinds of advertising formats on YouTube — some of which, he added, were developed through a partnership with Publicis. That agreement, which has taken shape over the last year, represented the start of a thaw in the previously frosty relations between advertising companies and Internet giants. Since then WPP has also struck a deal with Google to examine the future of digital advertising. Last week in Cannes, WPP, whose agencies include Ogilvy & Mather and Grey, Young & Rubicam, announced a separate research deal with Microsoft. Publicis, whose agencies include Saatchi & Saatchi and Leo Burnett, also moved to balance its partnership portfolio, announcing a broad agreement with Microsoft. The companies said they would jointly develop new kinds of digital advertising for a range of devices, including personal computers, mobile phones and Microsoft Xbox game consoles. They said they would also work on ways to send tailored advertising to individual television viewers’ sets.

Darren Huston, corporate vice president for Microsoft’s consumer and online businesses, described the linkup as “a major step forward in the relationship between our industries.” In addition to generating new business, he said, Mr. Ballmer intended the partnership to send a signal to Microsoft employees about the benefits of working with the ad industry. “It’s about the tone at the top,” Mr. Huston said. “What I’m saying, and what Steve is saying, is, ‘Here are some folks we’re going to work together with to crack some code.’ ” Analysts say there may be another reason for the new friendliness between Microsoft and companies like Publicis and WPP. Microsoft has been trying to sell a digital ad agency, called Razorfish, which it acquired two years ago when it bought the agency’s parent company, aQuantive, for $6 billion.

WPP and Publicis have reportedly been among the potential buyers; both companies declined to comment.