This paper studies targeted advertising in two-sided markets. Two platforms, with different targeting abilities, compete for single-homing consumers, while advertising firms are multi-homing. Ads overall impose negative externalities on consumers. When the targeting ability of the advantaged platform increases, (i) the advantaged platform will have more advertising firms, attract more consumers, and become more profitable, but its ad price and total volume of ads could either increase or decrease; (ii) the disadvantaged platform will have fewer advertising firms, attract fewer consumers, have fewer ads in total, increase its ad price, and become less profitable; (iii) all consumers will be better off. Finally, we compare social incentives and equilibrium incentives in investing in targeting ability, and find that underinvestment is most likely to occur.