Selfhosted banner ads service for static site on Hugo

Hello all!

I have static site made with Hugo and I want to add some banners with rotation (based on url or content) to some pages. I think this can be done via js call with some selfhosted ads services, but I wasn’t able to google any good opensource project for that.

Can somebody advise any opensource ad server or any other solution for this?