Shares of Zynga (ZNGA) may be down 42% since the company's IPO, but some bullish analysts are betting the online games maker will be this year’s comeback kid as it diversifies and discovers ways to profit from legal online gambling.

Of the 21 analysts polled by Thomson Reuters, five are strongly encouraging clients to buy Zynga, up from just two three months ago, while six have a “buy” rating on the gaming giant and 10 have a “hold” rating.

The upbeat views on Zynga come as it continues to diversify from Facebook (FB) and creates a gaming hub through Zynga.com. The optimism also follows reports that Zynga is looking into ways to capitalize on legal online gambling.

“We believe there will be gambling potential on nearly all of Zynga’s games.”

- BTIG analyst Richard Greenfield

Zynga, which got its start with Texas HoldEm in 2007, saw its top-line surge after its avatar farm game “Farmville” went viral on Facebook and Poker started to pick up in Apple's (AAPL) iOS App Store, leading to a $1 billion initial public offering in December.

It has since doubled down on the “ville” games, launching a slew that includes CastleVille, CityVille and Petville, and has unleashed what it calls "with friends" games, including Words with Friends and Hanging with Friends, which are akin to virtual knock-offs of traditional games like Scrabble and Hangman.

Yet, Zynga's shares have continued to fall since its public launch on the Nasdaq, which is a sign investors are disappointed with its portfolio and the handling of its operations in the first eight months of public trade. Zynga, after all, is tracking toward a decline in daily active users from this year's first quarter. 

However, Poker continues to be a bright spot for Zynga, which may be one reason the San Francisco-based game giant has recently revisited its roots by developing traditional casino games like Bingo and Slots.

The renewed focus on traditional casino games also comes amid sweeping changes to the online gambling industry.  After booting poker sites like PokerStars last year, the Department of Justice around the start of the year said it would allow states to make their own decisions on whether or not they’d allow online gambling to be legal within their borders.

Nevada was the first state to legalize online gambling earlier this year, with locally based slot machine makers International Game Technology and Bally Technologies scoring the state’s first gambling licenses. Delaware signed the bill to legalize online gambling last week and New Jersey is expected to follow shortly.

"We believe there will be gambling potential on nearly all of Zynga’s games,” BTIG analyst Richard Greenfield said in a recent report.

Zynga Poker raked in $47 million in revenue during the first quarter, or 16% of Zynga’s total online game revenue. Slots quickly became one of the most downloaded free apps shortly after it launched on iOS earlier this month and is now a top-15 grossing app.

“We believe the Slots launch is particularly important for Zynga, as it is part of the casino gaming vertical, which Zynga is in the process of building,” Greenfield said.

Unlike other tech companies that have struggled with mobile, Zynga Poker has managed to monetize mobile and remains the No. 7 grossing app on iOS. Poker apps have been profitable across the board, including Texas Poker by KamaGames, which is the 26th top grossing app.

Greenfield says the success of Zynga Poker and its rivals is a sign there’s “room for competition in the space.” While he said neither Texas Poker nor Zynga Poker are the top 50 most downloaded in the iOS store, their position shows they have a steady group of users that ensures a constant revenue stream.

Likewise, the market for slots has so far been pretty robust. Zynga Slots joins Slotomania by Playtika, which is the No. 6 top grossing app on iOS, while Slots Journey by FishSticks is No. 20.

BTIG is encouraging Zynga to build out its games in the casino space, especially slots, which are expected to be successful with the onset of legal web gambling because of their addicting nature.

Several of Zynga's products, including the “ville” games and Poker and Slots, already use fake money. Zynga Poker starts players off with a sum of virtual money and gives them the ability to get free chips every eight hours and acquire more if they share the game with friends. It would presumably be logical to adopt a platform where players had the ability to use real money.  

“As a major player in the virtual currency world, there’s obviously the potential that any game they have can be valuable if the rewards were real money rather than fake money,” Greenfield said.

Zynga, whose easiest transition to real-life wagering would be through partnerships with existing casinos, is said to be in talks with casino titan Wynn Resorts (WYNN) on creating a strategic online partnership that would capitalize on legal online gambling.  

The relationship would be mutually beneficial, as it would give Zynga access to serious poker fans and talent that has long dominated the casino industry, while giving Wynn access to Zynga’s estimated 232 million average monthly active users.

Neither Zynga nor Wynn responded to FOXbusiness.com for a comment.

While Zynga has just recently revisited traditional casino games, Greenfield said there is “significant opportunity” for the game maker given its size and scale. He estimated Zynga will focus on entering the casino vertical over the next 12 to 18 months.

“This is a huge company built around games that end up with over 60 million players a day with a lot of very competitive players,” Greenfield said. “In a world of legalized gambling, that’s clearly an upside.”

At the same time, Zynga has been separating itself from Facebook by creating a social hub for gamers and focusing on building its mobile presence, an area that has been difficult to master for many large Internet companies.

“It’s very clear that Facebook has had trouble figuring out mobile, so has Google (GOOG), Yahoo (YHOO) and every major Internet brand,” said Steve Beck, founder and managing partner of cg42, a boutique consulting firm. “I think Zynga is wise to attempt to figure out a way to chart [its] own course relative to mobile and tablet.”

Greenfield, who said Zynga’s “biggest opportunity” was to create its own platform, said the central hub allows the game maker to analyze trends and user activity and more quickly adapt to market changes.  

The company unveiled a slew of games last week, including two new “ville” games, which investors seemed to yawn at, Beck said, possibly because it’s a sign Zynga is using the same old formula as opposed to moving in “new and interesting” directions.

However, monitoring data trends more closely through it personal platform gives Zynga “the ability to predict next month’s behavior by this month’s behavior,” Greenfield said.

Zynga has also opened its doors to third-party developers, which is admitting that they “don’t know where the next hit is going to come from” and are focusing on player liquidity, Beck said. That mindset could put them at an advantage to competitors that have a narrower focus.

Of course, there are still skeptics. Piper Jaffray cut Zynga's price target to $9 from $13 last week, though it maintained its overweight rating.  

“Investors are not giving Zynga any credit for improving monetization,” Greenfield said, adding that “investors simply do not believe Zynga's online gaming is a sustainable business, especially Facebook-based gaming, which is now hated by investors.”

Follow Jennifer Booton on Twitter at @Jbooton