• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Excluding Google Ads From A Forum With Questionable Content

DRE

Well-known member
#1
Today I got a violation by Google for this thread.

I have never displayed ads in that subforum because I use a conditional to exclude my ad from that subforum. For some reason, I still got in trouble from Google. Is it because the code shows in the source code? How can I prevent the google ads from showing up at all in a template since conditionals still show the google ads in the source code? BTW I removed the ad code so you won't see it in the source if you look now but yes, google ads do show in the source code even when using a conditional.

This is the template conditional I use in ad_above_content and other ad templates:

(17 is the subforum that I've excluded from Google ads, that this thread is in)

Code:
<xen:if is="in_array({$forum.node_id}, array(17,134))"><xen:else /><xen:hook name="ad_above_content" />
<div class="gad_t"><script type="text/javascript"><!--
google_ad_client = "ca-pub-blahblah";
/* Top Banner */
google_ad_slot = "blahblah";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></xen:if>
 

Jake Bunce

XenForo moderator
Staff member
#2
That condition will show the ad in all forums except 17 and 134. The code will be completely removed in those forums.
 

DRE

Well-known member
#3
That condition will show the ad in all forums except 17 and 134. The code will be completely removed in those forums.
That condition works I know, but in the source code, the ad is still there. I think that's why Google penalized me for it.
 

DRE

Well-known member
#5
It shouldn't be. There must be ad code somewhere outside of the conditional. Or maybe you are editing a different style than you are viewing.
Your right! I found out it was this addon that made the adsense show even though I hid it in conditionals.

I tested it out and the direct template edits work as far as hiding the ad, but putting the conditionals even inside Digital Ad Positioning doesn't work. :(

http://xenforo.com/community/resources/digital-point-ad-positioning.232/