Generally speaking, insider buying is a big vote of confidence, simply because there is only one reason to buy a stock: The buyer believes it will be worth more in the future. Building on that idea, insiders scooped up shares of The Trade Desk (TTD -6.23%) and HubSpot (HUBS -3.88%) in May, even as the stock market was plunging.

Director David Wells bought 17,500 shares of The Trade Desk stock, a purchase valued at $801,000. And chief technology officer Dharmesh Shah bought 10,000 shares of HubSpot stock, a purchase valued at $3.4 million. That conviction bodes well for both companies, so investors should consider adding these magnificent growth stocks to their own portfolios.

Here's why.

1. The Trade Desk

The Trade Desk operates a demand-side platform (DSP), a technology that helps advertisers create, measure, and optimize targeted digital campaigns. The company benefits from content neutrality and its exclusive focus on the buy side of ad transactions, which eliminate the conflicts of interest created by walled garden business models.

Speaking of walled gardens, Alphabet (GOOGL -1.82%) (GOOG -1.80%) is a perfect example. The company works with ad buyers and sellers, and it sells its own ad inventory from Google Search and YouTube. That means Alphabet has a clear incentive to push its own inventory, and it faces the impossible task of doing right by both advertisers and publishers. Ultimately, that makes its business model far less transparent.

The Trade Desk has also distinguished itself through cutting-edge technology. Management says its DSP features the most advanced measurement marketplace in the industry, helping advertisers better understand campaign performance. Its platform is also built on bid-factor-based architecture, which enables more expressive targeting than the line-item-based architecture used by other DSPs.

Those competitive advantages have helped The Trade Desk keep its customer retention rate above 95% for the past eight years and fueled strong financial results. Revenue soared 44% to $1.3 billion over the past year, and free cash flow climbed 11% to $394 million.

Looking ahead, the digital ad industry is rapidly approaching a $1 trillion addressable market, and The Trade Desk is well positioned to take market share. As the leading independent DSP, it sees 13 million ad opportunities each second, and every campaign powered by its platform makes its artificial intelligence engine better at driving positive outcomes for advertisers. That flywheel effect should be a continuous tailwind for the company.

The Trade Desk's share price is currently 58% off its high, and shares trade at 18.1 times sales, an absolute bargain compared to the three-year average of 30.5 times sales. That's why this growth stock is a smart buy now.

2. HubSpot

Customer relationship management (CRM) software has become a mission-critical technology for many organizations, and HubSpot was recently recognized as the leading CRM vendor among small businesses in a report from G2 Grid. Its platform features productivity software for marketing, sales, customer service, and operations, and a content management system that helps organizations engage potential customers with personalized web experiences. Put simply, HubSpot gives its clients the tools they need to build and maintain lasting customer relationships.

As a leader in the CRM market, HubSpot has consistently delivered solid financial results. The company saw its customer count rise 26% over the past year, while the average subscription revenue per customer rose 12%, evidencing a successful land-and-expand growth strategy. In turn, revenue jumped 47% to $1.4 billion, and free cash flow skyrocketed 153% to $188 million.

Looking ahead, HubSpot is well positioned to keep that momentum. It has demonstrated its capacity for innovation on countless occasions, and the quickly growing CRM market should be a powerful tailwind.

HubSpot recently launched a redesigned version of Service Hub, which now features omnichannel communication, AI-powered insights, and workflow automation tools for customer service agents. The company also introduced HubSpot Payments, a tool that allows businesses to process payment transactions and capture commerce data within the CRM platform. Innovations like these create value for customers, and they should keep HubSpot in growth mode for years to come.

Additionally, the CRM market is expected to grow at 13% per year to reach $158 billion by 2030, according to Grand View Research. That puts HubSpot in front of a big opportunity, and with shares trading at a reasonable 10 times sales -- a discount compared to the three-year average of 17.5 times sales -- now is a great time to buy this stock.