In programmatic advertising, bids are increasingly based on knowledge of the surrounding media context. This shift toward contextual advertising is in part a counter-reaction to the current dependency on personal data, which is problematic from legal and ethical standpoints. The transition is accelerated by developments in artificial intelligence (AI), which allow for a deeper semantic analysis of the context and, by extension, more effective ad placement. We survey existing literature on the influence of context on the reception of an advertisement, focusing on three context factors: the applicability of the content and the ad, the affective tone of the content, and the involvement of the consumer. We then discuss how AI can leverage these priming effects to optimize ad placement through techniques such as reinforcement learning, data clustering, and sentiment analysis. This helps close the gap between the state of the art in advertising technology and the AI-driven targeting methodologies described in prior academic research.