I'm sure on occasion most of us have heard a song on the radio, online, whatever, and thought "oh that's a cool song" and start listening to it for a good while, and later when finally looking up info on the song you're surprised to find the song was first created for the purpose of promoting something, be it a tv show, a movie, or a game.
The most recent example for me was discovering that the (now a decade old) eurodance song "Angel of Darkness" by Alex C. and Yasmin K. actually was in fact created as a promotional song for the sixth Tomb Raider video game, subtitled "Angel of Darkness." At first I thought it was just a coincidence the song and game shared a name, but nope when I found the official music video on YouTube recently, the video itself uses footage from the game in the video, and even has scenes where the singer and DJ turn into polygonal character models and start running around environments like Lara Croft.
Another fairly recent one is Eminem's song Survival, which was made for the game Call of Duty: Ghosts (similar situation, it's made obvious if you see the music video, which uses footage from the game):