The solution that I used was to create ads that were turned on and off with CSS. It’s a bit of a hack (in the sense that it’s inelegant) but it works well enough for the client that needs it.
I think I can imagine a plugin that solved this a bit more elegantly if you have a budget.
Do you need just one ad per category? Or do they need to rotate?