Actually I just noticed this in the "Similar Threads" below:
https://vborg.vbsupport.ru/showthread.php?t=250513
So that might help you. It also seems to say that you *can* put it in the ad code, so maybe I'm wrong about that (I'll check the code when I get a chance).
Edit: no need to check the code, it says right on the ad editing page that conditionals *are* allowed. So, try the one at the link above.