Discourse’s ad plugin is not about handling targeting but mostly about placing the ad units code into Discourse’s output. One may use something like DFP (Ad Manager) for the geo/etc targeting. I don’t think this plugin should handle the targeting bits.
It does already have a setting for not showing ads above a certain trust level. Our need (again, specific to our SSO setup) is sort of the reverse: to not display ads at all to guests as they have not given the consent.
I’m new to Ruby and Discourse’s codebase but will take a look at the code and see if I can figure something out. Hints appreciated.