NASCAR had come a long way from the days when it was dismissed as Southerners driving around in circles turning left. There was rising attendance at tracks, increasing television ratings for races and growing demand from marketers to be sponsors.

But all that was halted — and even reversed — by a brutal one-two punch from the recession and changing demographic trends. The economic recovery, sluggish as it has been, is helping Nascar on the financial front. But there remains a crucial issue: attracting the next generation of fans, adding to the existing loyal base — primarily older, rural white men — people who are younger, urban and multicultural.

Nascar has been working since 2009 on plans to stimulate long-term growth, which involved studies, focus groups and a change in advertising agencies. The longtime incumbent, the Jump Company in St. Louis, was replaced in July by a Madison Avenue giant, Ogilvy & Mather Worldwide, known for sophisticated work for blue-chip brands like American Express, Dove and I.B.M.

“I don’t think people saw that coming,” Kim Brink, managing director for brand, consumer and series marketing at Nascar, said of the choice.