From dorm room to global domination, Facebook has emerged in recent years as one of the world's largest and most profitable companies based on its ability to target advertising to its users.

The tech giant is now at the center of a growing debate about the extent to which companies should be able to take advantage of the flood of data available on users. Facebook is also being forced to confront broader questions about the company's quest to connect the world through its social network.

A new documentary from FRONTLINE, the PBS investigative series, delves into the history of the company and how it went from a startup to what critics are calling the largest surveillance apparatus ever constructed. The clip below, provided exclusively to NBC News, highlights a major turning point in Facebook's history — when it began to look for data beyond its network.

"The Facebook Dilemma," a two-night documentary from the PBS investigative series FRONTLINE premieres Oct. 29 at 9 p.m. ET and Oct. 30 at 10 p.m. ET on PBS and online.