Digital platforms such as Facebook create value by connecting users, vendors, and contractors. Their strong supply and demand economies of scale can give them market power, and have led to increasing calls for special regulations and taxes. We construct and illustrate an approach for structural modeling of digital platforms. The model allows for heterogeneity in demand elasticity, disutility from advertising, and network effects across users. We paramaterize our model using a survey of over 57,000 US internet users on their demand for Facebook's eponymous application. Facebook creates $14 billion in social value per month, with consumer surplus concentrated among female and older users of Facebook. The most valuable friendships on Facebook are worth in excess of 50 cents per month, but most are worth far less, with connections to men more valuable on a per-friend basis. We find that Facebook has too low a level of advertising relative to their short-term profit maximizing strategy. Imputing their shadow value from maintaining a large user base, we estimate that the welfare lost from Facebook's market power, compared to the first best of a social welfare maximizing Facebook, is 9.6% of current social value, or $1.3 Billion per month. We then simulate six proposed policies for government management of digital platforms, taking Facebook's optimal response into account. Taxes are mostly incident on Facebook profit and properly targeted taxes can even raise consumer surplus. Achieving perfect competition in social media would raise social surplus from Facebook by 4.8% of current value. But a botched regulation that left the US with two smaller, non-competitive social media monopolies would decrease social surplus by 84.7%.