Actually in this case it's pretty easy. If you're gay and use dating apps, and didn't opt out of application usage history in your settings, the presence of those apps in your history will flag you as having that interest to advertisers. The google analytics get resold/repackaged, either directly or indirectly through data brokers, to Facebook. Facebook suddenly starts displaying ads for expensive mens' underwear.