Hide ads when user logged in

Hi, Iā€™m wondering if it would be possible to setup google ads with the function that it hides the ads when a user is logged in?

Thanks :slight_smile:

This can be achieved by utilizing the @member helper

Inject this code in your theme

{{#if @member}}
  <!-- insert code that is visible when the user is logged in /-->
  <!-- Google Ads code /-->
{{else}}
  <!-- insert code that is visible when the user is logged out /-->
{{/if}}

Thanks. Would this be in the code injection field in admin?

No, you need to use it in the theme directly.

FYI: I believe this corrected code would hide ads from logged-in members, instead of showing ads only to logged-in members:

{{#if @member}}
  <!-- insert code that is visible when the user is logged in /-->
Thanks for your ad-free support.
{{else}}
  <!-- insert code that is visible when the user is logged out /-->
  <!-- Google Ads code /-->
{{/if}}