Is it possible to deliver Google Adsense ads to non-paying users?

I want to only display ads for our non-paying users. Is it possible to do that with Ghost?

For the paying users, I want to avoid displaying ads towards them.

Yes, but the easiest way would be to edit the theme. Are you able to do that?

I know how to. But what code would we inject?

If you’re editing the theme (not code injection), you’d want to inject either the Adsense javascript within the handlebars code like {{#if @member}} member stuff {{else}} addsense stuff here{{/if}} OR insert a target div that Adsense will insert ads into.

Code injection doesn’t have access to the @member object as easily. You could instead look for changes in your theme’s subscribe/sign-in button to guess whether the user is signed up or not and then run the Addsense script or not, if you had to do it that way.