Internet stocks had a strong 2017 marked by prominent margin expansion and stock performance. The sector rallied 27% last year, easily topping both the S&P 500's 19% increase and the Russell 200's 13% increase.

Given that outperformance, a large portion of Wall Street has called for growth deceleration in the internet space in line with historical averages. Goldman Sachs, however, disagreed.

"With e-commerce growth accelerating, advertising dollars continuing to shift online and valuations near 5-year historic averages, despite recent outperformance, we expect upward estimate revisions and related multiple expansion will drive continued outperformance in internet," Goldman analysts wrote in a Jan. 19 note.

The internet sector is already up 4% year to date in the dozen trading days so far in 2018.

Goldman said that on a risk/reward basis large-cap names are "attractive given their disproportionate share gains." Amazon.com Inc. (AMZN) , Alphabet Inc. (GOOGL) and PayPal Holdings Inc. (PYPL) are on Goldman's conviction buy list, and Facebook Inc. (FB) and Netflix Inc. (NFLX) stocks are buy-rated. FANG has led internet outperformance, up 49% on average in 2017, and PayPal has rallied 87%.

Analysts added that there are "idiosyncratic opportunities" in small- and mid-cap names, including their buy-rated GrubHub Inc. (GRUB) , Pandora Media Inc. (P) , Twitter Inc. (TWTR) , ANGI Homeservices Inc. (ANGI) and Zillow Group Inc. (ZG) .

Also of importance is accelerating e-commerce growth, which increased 15% in the fourth quarter of 2017 from a year earlier. Goldman forecasts sustained growth, with e-commerce share gains up 147 basis points in 2018 vs. a gain of 134 basis points in 2017. That's especially good news for Amazon, eBay Inc. (EBAY) , GrubHub and PayPal.

Growth, leverage, innovation and competition are Goldman's main investment framework considerations. For growth, analysts like Snap Inc. (SNAP) , ANGI Homeservices, Facebook, GrubHub, Redfin Corp. (RDFN) , CarGurus Inc. (CARG) and Netflix, which are all set to grow sales more than 30% over the next three years.

For leverage, look to Pandora, InterActiveCorp (IAC) and Shutterfly Inc. (SFLY) , which all have incremental margins above 50%. Innovation leaders are those with high product development expenses over the past 12 months -- Amazon, Google, Facebook, Twitter, Redfin and Zillow Group.

As for competitive advantage, the best picks are Amazon, Google, Facebook, Netflix and PayPal.

But Goldman analysts noted that investors are sure to wonder when the multiple years of outperformance will come to an end. The risks to consider are regulation surrounding data, privacy and competition, and antitrust issues, which could both impact companies' abilities to grow.

Alphabet and Facebook are holdings in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio . Want to be alerted before Cramer buys or sells the stocks? Learn more now.

More of What's Trending on TheStreet:

More from Stocks

What You Need to Know About Facebook and Europe's New Privacy Rules

What You Need to Know About Facebook and Europe's New Privacy Rules

8 Bold Moves General Motors Could Make to Rev Up Its Battered Stock Price

8 Bold Moves General Motors Could Make to Rev Up Its Battered Stock Price

Is Your Investment Portfolio Prepared for Trade Wars, Inflation and More Trump?

Is Your Investment Portfolio Prepared for Trade Wars, Inflation and More Trump?

GE Is Too Opaque, Too Diversified and Too Poorly Managed: Doug Kass Insider

GE Is Too Opaque, Too Diversified and Too Poorly Managed: Doug Kass Insider

Dow Falls Over 200 Points as Apple's Slump Offsets Gains in General Electric

Dow Falls Over 200 Points as Apple's Slump Offsets Gains in General Electric