Analysts who follow public companies have a great deal of insight into just how much potential upside a stock has. Not only do they consider company-specific factors, but they take into account macroeconomic factors and the industry as a whole to determine how much a business may be worth. While price targets can often change, they serve as a good gauge to determine just how much bullishness there is behind a stock.

Two stocks that have already been having a great year in 2021 and that analysts think can still go higher are cannabis producer Tilray (TLRY -6.01%) and tech company Alphabet (GOOG 0.56%). Here's why these two soaring investments may continue to outperform the market.

Two people with laptop discussing papers.

Image source: Getty Images.

1. Tilray

Although shares of Tilray have been falling in recent months, the stock is still up by more than 64% since the start of 2021 -- that's well above the S&P 500's gains of just 21%.

A lack of progress on marijuana reform in the U.S. has led to less excitement in the sector, especially with growth stocks as a whole cooling off. But analysts remain optimistic that Tilray can still be a great buy at its current price. Multiple brokerages have set price targets at $19, indicating that they believe the stock could climb to those levels within the next year or two. That price would represent an upside of about 40% from the $13.59 price at which Tilray's stock closed last week.

There's excitement surrounding the strength of Tilray's business since combining with low-cost producer Aphria earlier this year. And there's certainly no lack of bullishness from CEO Irwin Simon, who believes the combined entity can hit $4 billion in annual revenue by 2024, a target I think might be a bit too optimistic.

For the three-month period ending May 31, the company reported net revenue of just $142 million. Although that was a year-over-year increase of 25%, it only equates to an annual run rate of around $570 million today.

If the company proves that it is making progress to hit Simon's ambitious numbers, that could certainly lead to some price target upgrades. In fact, any type of forward progress on marijuana reform in the U.S. could do that, as entering that market is critical for the Canadian-based producer to reach its goals.

Tilray has already set a plan in motion for the U.S market, acquiring convertible notes in multi-state operator MedMen which it could convert to own 21% of the business -- once lawmakers lift the federal ban on marijuana. And once that happens, Simon doesn't rule out Tilray taking an even bigger stake in MedMen.

Tilray is among the most promising pot stocks in Canada that you can buy right now. And with some exciting growth opportunities ahead, it wouldn't be surprising for its shares to continue rising over the next few years.

2. Alphabet

Tech stocks have been doing well amid the pandemic, and Alphabet has been no exception. Year to date, the stock is up 65%, having done even better than Tilray. Even as it hovers around the $3,000 mark, many analysts still have buy ratings on the stock and see it going higher than $3,200. One of the more bullish forecasts has Alphabet's stock climbing to $3,600 -- which would be a return of more than 24% from where it is today.

It's easy to see why there is so much hype: Last quarter, the company's revenue from YouTube alone reached more than $7 billion for the period ending June 30 -- nearly as much as the $7.3 billion total recorded by streaming giant Netflix in that period. And that segment could continue to grow, as Alphabet is targeting TikTok viewers with YouTube Shorts -- 60-second videos that are easy to create using just a smartphone. Ad revenue of more than $50 billion also soared 69% year over year.

Overall, Alphabet's revenue of $61.9 billion was up 62% from the prior-year period and came out well ahead of analyst expectations of $56.2 billion. Its earnings per share of $27.26 were also higher than Wall Street estimates of $19.34. However, the company was cautious in making any projections, stating on its earnings call that given the rise in COVID-19 case numbers, it's difficult to forecast how future quarters will pan out. 

Alphabet has been a good reopening play with ad spend back up, and as long as that trend continues, it's certainly possible for the stock to continue rallying.