What happened

Shares of online education company Udemy (UDMY -0.10%) were up on Thursday after the company's second-quarter financial results exceeded management's previous guidance and management raised its forward guidance for the rest of the year. As of 1 p.m. ET, Udemy stock was up 10%.

So what

Udemy's marketplace lowers the barrier to entry for course creation -- anyone can create and upload a course to the platform. It's for people who are looking for knowledge, not certificates or degrees. Management thought it would generate $151 million in Q2 revenue at most. But the company generated $153.1 million in Q2, up 21% year over year.

Of particular strength in Q2 was Udemy Business. Companies looking to provide training to their workers can subscribe to Udemy's curated list of user-generated courses. Udemy Business was up a whopping 77% year over year and accounted for 49% of total revenue. In short, it's gaining new enterprise customers and they're spending more on average this year compared to last year. That's a good sign for this high-growth part of the business.

Now what

For the year, Udemy management expects revenue of $615 million to $640 million. This is a slight increase from previous guidance of $610 million to $640 million. 

One thing to watch is Udemy's profitability. It expects negative profits this year, even on an adjusted basis. Some investors might be concerned with this considering its gross profit margin is a healthy 57%. In short, Udemy spent 78% of its gross profit on sales and marketing. That's the primary reason it's not profitable and it's something to watch. But at least this heavy spending is resulting in strong growth.

All in all it was a good quarter for Udemy. But investors need to monitor growth and customer retention to make sure its spending decisions are justified.