Facebook built itself into the No. 2 digital advertising platform in the world by analyzing the vast amount of data it had on each of its 1.3 billion users to sell individually targeted ads on its social network. Now it is going to take those targeted ads to the rest of the Internet, mounting its most direct challenge yet to Google, the leader in digital advertising with nearly one-third of the global market.