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) - Get Amazon.com, Inc. Report , Alphabet Inc. (GOOGL) - Get Alphabet Inc. Class A Report and PayPal Holdings Inc. (PYPL) - Get PayPal Holdings Inc Report are on Goldman's conviction buy list, and Facebook Inc. (FB) - Get Facebook, Inc. Class A Report and Netflix Inc. (NFLX) - Get Netflix, Inc. (NFLX) Report 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) - Get Grubhub, Inc. Report , Pandora Media Inc. (P) , Twitter Inc. (TWTR) - Get Twitter, Inc. Report , ANGI Homeservices Inc. (ANGI) - Get ANGI Homeservices Inc Class A Report and Zillow Group Inc. (ZG) - Get Zillow Group, Inc. Class A Report .

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) - Get eBay Inc. Report , GrubHub and PayPal.

TheStreet Recommends

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

For leverage, look to Pandora, InterActiveCorp (IAC) - Get IAC/InterActiveCorp. Report and Shutterfly Inc. (SFLY) - Get Shutterfly, Inc. Report , 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: