1. 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

Discussion in 'Styling and Customization Questions' started by DRE, Oct 23, 2012.

  1. DRE

    DRE Well-Known Member

    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)

    <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 type="text/javascript"
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That condition will show the ad in all forums except 17 and 134. The code will be completely removed in those forums.
  3. DRE

    DRE Well-Known Member

    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.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
  5. DRE

    DRE Well-Known Member

    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. :(


Share This Page