A founder talks about selling his location-measurement startup to Snap then Foursquare, and how he survived the tough ad-tech climate