Lululemon is doing what most retailers would kill to do — getting online customers to spend on its website.

The athleisure company's e-commerce game is part of the reason why it reported an earnings beat for the fourth quarter of 2017, and also a reason why analysts are optimistic about its prospects.

The retailer posted an adjusted $1.33 per share and revenue of $928.80 million, above analysts' expectations of $1.26 per share and $912.42 million in revenue. Meanwhile, its e-commerce sales increased by 42% on a constant dollar basis for the quarter, on top of a 12% increase last year, the company reported.

The e-commerce boost was largely attributed to the relaunch of its website, which made it more attractive and easier for consumers to shop.

"Our digital and ecommerce business saw structural changes with transformative investments across people, process, and technology," Celeste Burgoyne, Lululemon's vice president of the Americas, said in an earnings call. "In short, it's working."

The company's stock spiked 10% on Wednesday, a day after reporting earnings.

The retailer has plans to hit its goal of $4 billion in sales by 2020, including $1 billion from online sales, $1 billion from international sales, and $1 billion in sales of men's apparel. Some analysts at Wall Street felt it was well on its way.

"We see further opportunity ahead, as product and digital initiatives take hold and the int'l growth story continues," Randal Konik, a Jefferies analyst, wrote in a client note on Wednesday. However, Konik believes the company's valuation is too high.

Konik maintained a "Hold" rating on the company, and a price target of $82 per share.

Other analysts were more bullish. Credit Suisse's Michael Binetti says there are multiple drivers supporting a ramp up in sales, including the company's increased capex investments, its co-located men's and women's stores that are driving traffic, and its continued e-commerce strength.

Binetti raised his price target to $98 per share from $96.

Lululemon's stock was trading at $86.63 per share, and was up 8.75% for the year.

This post has been updated to reflect the correct year for Lululemon's $4 billion target of 2020. It previously stated the year as 2022.