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

**URL:** <https://forum.ghost.org/t/is-it-possible-to-deliver-google-adsense-ads-to-non-paying-users/41184>\
**Category:** Integrations & API\
**Created:** [September 13, 2023, 11:46pm UTC](https://forum.ghost.org/t/is-it-possible-to-deliver-google-adsense-ads-to-non-paying-users/41184 "2023-09-13T23:46:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazilzaim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jazilzaim/32/26321_2.png) [@jazilzaim](https://forum.ghost.org/u/jazilzaim)\
**Post date:** [September 13, 2023, 11:46pm UTC](https://forum.ghost.org/t/is-it-possible-to-deliver-google-adsense-ads-to-non-paying-users/41184/1 "2023-09-13T23:46:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 14, 2023, 2:37am UTC](https://forum.ghost.org/t/is-it-possible-to-deliver-google-adsense-ads-to-non-paying-users/41184/2 "2023-09-14T02:37:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jazilzaim](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jazilzaim/32/26321_2.png) [@jazilzaim](https://forum.ghost.org/u/jazilzaim)\
**Post date:** [September 14, 2023, 3:06am UTC](https://forum.ghost.org/t/is-it-possible-to-deliver-google-adsense-ads-to-non-paying-users/41184/3 "2023-09-14T03:06:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 14, 2023, 7:49pm UTC](https://forum.ghost.org/t/is-it-possible-to-deliver-google-adsense-ads-to-non-paying-users/41184/4 "2023-09-14T19:49:05Z")

</div>

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.
