Hey,
There’s already a built in option to do that. It’s called Conditional Display and allows you to define conditions on which the banner would be displayed or hidden. Please check – it should be exactly what you need.