The brand, which is backed by the supermarket chain Waitrose, began talks with seven agencies at the start of the year.
Ocado is now turning its attentions to a review of its media planning and buying account, held by Brand Connection. Four agencies will compete for the account against the incumbent.
O&M won the business after a final shoot-out against Ben Mark Orlando. The review followed the decision by Heresy, the integrated agency, to resign the account in January, three years after winning it. Heresy created Ocado's current ad campaign, which launched in November 2002 using the strapline: "Be more demanding."
Paul Jackson, O&M's chief executive, said: "Everything we have seen about Ocado is about excellence. It's a brand which is going to be very successful and we're very pleased to be partnering it."
Claire Harper, the head of customer acquisition at Ocado, said: "We are tremendously excited by the opportunity of working with the Ogilvy team. They have excelled themselves strategically and creatively throughout the pitch process and impressed us greatly with their thinking on where Ocado can go next."