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. We show that the platform with a higher targeting ability will attract more consumers and have more advertising firms. When the targeting ability of either platform increases, all consumers benefit as they will incur lower nuisance costs from advertising. Compared to the equilibrium outcome, monopoly ownership always leads to more skewed consumer allocation between two platforms. We also compare the advertising levels and consumer allocation under the social optimum and those under equilibrium. We find that in most cases, platforms underinvest in targeting abilities in equilibrium.