Amazon (AMZN -0.66%) surged higher by 10% following its second-quarter earnings report, but it might be the conditions of that gain that make the surge so notable. Amazon did not rise because of its earnings; it reported a quarterly loss and fell short of estimates on a key metric.

However, successes in other areas made it easier for investors to overlook bad news. That changed perception could become a significant catalyst for Amazon stock as it works to recover from the bear market.

Amazon's earnings

On the surface, Amazon's earnings seem uninspiring. Net sales of $121 billion beat estimates of $119 billion and grew 7% from year-ago levels. Nonetheless, net losses of $2 billion, or $0.20 per share, fell well short of the $0.13 net income that analysts had expected.

Amazon posted losses primarily because its operating expenses rose 12%. Additionally, Amazon logged $6 billion in non-operating losses during Q2, which stands in contrast to $1 billion in non-operating income in the year-ago quarter.

The areas where it struggled most are its North America and international segments, the parts of the company driving the overwhelming majority of Amazon's revenue. Since operating expenses exceeded net sales in both segments, they reported a combined $2.4 billion in operating losses.

However, Amazon continues to show strength in one key segment -- Amazon Web Services (AWS). This cloud division posted net sales of $19.7 billion, rising 33% compared with year-ago levels.

Moreover, despite accounting for only 16% of company sales, it reported an operating income of $5.7 billion, a 36% increase year over year. This means that Amazon earned a total of $3.3 billion in operating income thanks to its cloud segment.

Amazon also released a more positive Q3 net sales outlook. It forecasts quarterly net sales of $125 billion to $130 billion. This amounts to a 15% increase at the midpoint. Also, since analysts had forecast $126.4 billion in net sales, this could point to a slight increase if it hits the $127.5 billion midpoint.

What the reaction may mean

More importantly, it shows that investors seem to now perceive Amazon as a conglomerate as opposed to just a retailer. This is a positive development since its net product sales fell over the previous 12 months. Also, AWS's operating income has become the one number that matters as it has long served as Amazon's primary earnings driver. In the case of Q2, AWS made up all of the company's positive operating income.

Moreover, the company now publishes results for its advertising services, a non-retail business that can now attract more attention. In Q2, advertising made up almost $8.8 billion of its quarterly net sales. This was an 18% increase at a time when many ad-related stocks reported disappointing earnings.

Given these changes, its retail business performance might seem uninspiring. Indeed, retailing is a low-margin business that requires high fixed costs. Its North America and international retail segments reported operating margins of -0.5% and -4.6%, respectively, for the trailing 12 months, a sharp contrast to AWS's 31.1% margin.

The current struggles do not mean that investors should refer to Amazon's retail operations as loss leaders. These segments turned a profit in the past and will likely do so again. However, segments such as AWS and its advertising business will probably drive most of the profits and, by extension, the growth of Amazon stock.

Investing in Amazon

Investors' positive reaction to a mixed earnings report bodes well for Amazon stock. Despite a lackluster performance in e-retailing, Amazon shares rose as investors responded to the successes of its non-retail segments.

E-commerce will probably continue to drive most of the company's revenue, and the company should remain a major force on the retail scene. But for stockholders, businesses such as AWS and advertising will likely serve as the main reasons to own this internet and direct-marketing retail stock.