XF 2.2 Hiding Google AdSense Banners from Certain Member Groups

jar546

Member
First, I did not set up this forum, I just organized and have been running it for the past 15 years. Next I use Google AdSense to place banners on my Xenforo forum to help generate revenue and offset my costs. I have searched templates in the ACP for the word Google and other than analytics, I am coming up empty. I do have Ads Manager 2 and cannot find anything when I search there either. I have ZERO clue where my AdSense code is located, therefore I cannot make adjustments to it other than in my Google AdSense account.

I realize that if Ads Manager 2 is where I make this adjustment they I will have to repost this in that part of this forum but I have no clue which is why I am posting it here. I now have CPanel to make my life easier with my AWS setup so I can find what I need and edit it much easier. I don't know if I can do what I want.

There is one group that is a paying group on my site that as a benefit, I don't want them to see the Google AdSense banners. Is this possible and if so, how the heck do I do it? I just can't figure it out. Thanks in advance.
 
I have ZERO clue where my AdSense code is located
Open page source in your browser on a page with ads showing, locate he Adsense code, copy a small phrase/part of it, then within ACP user Template Search - /admin.php?templates/search - to locate it.

There is one group that is a paying group on my site that as a benefit, I don't want them to see the Google AdSense banners. Is this possible and if so, how the heck do I do it?
Code:
    <xf:if is="{{!$xf.visitor.isMemberOf([x, y, z])}}">
        --- Google Adense Code here ---
    </xf:if>
Place this xf:if wrapper within your template that has your Adsense code.
x, y, z is a numeric for the usergroup(s) you want to exclude from seeing Adsense. /admin.php?user-groups/.
The x|y|z numeric to use is in the URL when you click on the usergroup.
 
Open page source in your browser on a page with ads showing, locate he Adsense code, copy a small phrase/part of it, then within ACP user Template Search - /admin.php?templates/search - to locate it.


Code:
    <xf:if is="{{!$xf.visitor.isMemberOf([x, y, z])}}">
        --- Google Adense Code here ---
    </xf:if>
Place this xf:if wrapper within your template that has your Adsense code.
x, y, z is a numeric for the usergroup(s) you want to exclude from seeing Adsense. /admin.php?user-groups/.
The x|y|z numeric to use is in the URL when you click on the usergroup.
I actually found in the source exact verbiage that says adsbygoogle and when I search for that in the templates and all add ons, nothing comes up at all. This one has me stumped.
 
Back
Top Bottom