It's been a bumpy few years for the housing market, but Americans still regard real estate as the best long-term investment, according to a new Gallup survey.

The survey found that a plurality of Americans said they favored real estate as an investment, exceeding those who said they preferred gold, stocks, savings and other common investments.

Increasingly popular since 2011

As an investment, real estate has grown increasingly in favor among Americans over the past few years, according to the annual Gallup polls, even though the housing market continues to struggle. Thirty percent of all respondents named real estate as their favored long-term investment, up from only 19 percent as recently as 2011.

That's still well below the half of Americans who favored real estate in 2002, back during the boom years. Recent improvements in housing prices may be a key reason why real estate has been coming back into favor, according to Gallup.

Less-favored investments were gold and stocks/mutual funds, both picked by 24 percent of respondents, savings accounts and CDs at 14 percent, and bonds favored by only 6 percent of respondents.

Real estate more favored by high earners

Wealthier Americans were the most likely to favor real estate as a long-term investment, which the polling firm suggested may be due to the fact they are the group most likely to have experience with buying and owning property. Of those with annual incomes of $75,000 and more, 38 percent said they thought real estate is the best long-term investment.

By contrast, lower-income Americans named gold as their top choice, named by 31 percent of those with incomes under $30,000, though 28 percent of this group favored real estate. The middle group, those with incomes of $30,000 or more but less than $75,000 split evenly between gold and real estate at 26 percent each.

Overall, gold has been declining in popularity as a long-term investment choice in recent years, dropping from 31 percent in 2011. Stocks and mutual funds have been coming back into vogue, rising from the favorite choice of 17 percent in 2011.

Bonds have fallen in favor as the economic picture brightened in recent years, dropping from the choice of 10 percent in 2011. Despite the safety they offer, their relatively low returns have always made bonds the least-popular long-term investment since Gallup began conducting the survey.