Watching selling activity from insiders can be tricky, especially considering that sales from insiders don't always signify a lack of confidence in the company. Rather, many insiders get paid via stock, so they sell chunks frequently to fund their lifestyles. A stock purchase, however, typically suggests confidence in the company. 

Therefore, aggressive insider buying activity within The Trade Desk (TTD -4.28%) and Confluent (CFLT -2.50%) is exciting. In May and June, big names bought up shares: Brad Gerstner, CEO of Altimeter Capital and a 10% shareholder of Confluent, bought more than 131,000 more shares of Confluent bringing his stake to more than 14.4 million shares. And one member of The Trade Desk's board of directors, David Wells, has also been an active buyer. In May, the former Netflix CFO acquired 17,500 shares of The Trade Desk to bring his total stake up to more than 106,000 shares.

Should investors follow in the footsteps of these two millionaires? Here's why that might be a wise decision. 

1. The Trade Desk

While Wells might have been a big buyer, the rest of the market wasn't fond of this advertising stock: Shares have plummeted over 32% year-to-date. However, the company has continued to thrive, even during a difficult time for advertising businesses. This might be why Wells added to his position.

It hasn't been a great time for advertising companies this year. As a recession looms and inflation keeps rising, businesses have started to pull back on spending. One of the easiest places to do so is on advertising -- and considering The Trade Desk makes money by facilitating ad transactions, it would seemingly get damaged. That wasn't the case, however. The Trade Desk posted stellar second-quarter results, highlighted by a 35% year-over-year jump in revenue to $377 million. Additionally, management is anticipating Q3 revenue of at least $385 million, implying 28% year-over-year growth.

The Trade Desk is likely thriving because of its leadership in the space. While advertisers have to cut ad budgets, they don't have to do so across the board. Instead, advertisers can cut spending on risker ad strategies and continue relying on mission-critical platforms like the Trade Desk to make the most of their tightened ad budgets.

Wells also might have bought shares because of The Trade Desk's long-term opportunity, driven by some considerable tailwinds. Roughly $750 billion gets spent on global advertising annually, and digital advertising's share of that is expected to rise substantially. PubMatic -- one of The Trade Desk's partners -- predicts that by 2024, $627 billion will get spent on digital ads globally. With over $476 million in trailing 12-month free cash flow, The Trade Desk has the money to invest to capture a piece of this huge pie.

Shares of the Trade Desk aren't cheap on an absolute basis at 64 times free cash flow, but this is low compared to past valuations. At this multiple, The Trade Desk is closer to its five-year low than its average valuation over the same period. And while these prices might seem expensive, Wells thinks it's the right time to add shares. You might want to consider it as well.

2. Confluent

Shares of Confluent have also been beaten up this year, with shares down 67% year-to-date. Like The Trade Desk, however, Confluent has continued to execute in 2022. Confluent helps businesses analyze data instantly and at scale, which hasn't been the historical norm. However, the demand for real-time analysis has been high, so Confluent's products have gained tremendous traction. In Q2, Confluent saw revenue increase 58% year-over-year to $139 million.

This was especially impressive given the economic backdrop. With the economic headwinds pushing all companies, many investors thought businesses would cut out non-discretionary software platforms, Confluent being one of them. However, the company proved in Q2 that it is a need-to-have service for its customers. Customers increased their reliance on Confluent in Q2, with those spending over $100,000 annually rising 39% versus the year-ago period to 857.

Confluent is also operating in a lucrative market. The company estimates its addressable opportunity will be worth $91 billion by 2024. There's plenty of room to run from here, considering it only generated $488 million in revenue over the trailing 12 months.

With Confluent's disruptive product and high retention (even during a precarious economic environment), there's plenty to like about the company today. This might be why Gerstner has added so much to his position in the company. While there are some risks, Confluent could be a great company to own in a diversified portfolio.