Current typical Ad Network scenario is quite evolved, but we are still struggling in terms of relevance and getting the CTR up. Generic targeting (like device, OS, geo) does not seem to help in most of the cases.
We have been trying to mine User data, but that comes with privacy and missing data issues. Companies like Google and FB are frowned upon because of collecting that data as well.
Publishers (App Owners) usually attach ad requests to an event and they the best judge of current context in terms of app about the user's current mental state.
We have approached this problem by using a semantical relationship between the context given about the ad by advertiser and context given about the user in App, at an Ad Request Event.
We then use a lexical database to change the context of the user into a vector and measure its nearness with the vectors given by the Ad Owners. We calculate a score based on it and shortlist ad to be served in realtime. This system can then be easily used to loop back and learn to improve the matching logic (scores) itself.