Is there a way to disable Google Adsense integration in individual forums, while leaving them running everywhere else?
Selectively disabling Google Adsense in certain forums
Collapse
X
-
You can edit the templates and use conditionals:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Ad Location Templates
For example, this condition will exclude forumid X:
Code:<if condition="$forumid != [color=red]X[/color]"> </if>
-
Thanks. When I go to edit one of these templates, say ad_navbar_below, nothing actually shows. I'm not seeing any code into which to insert that conditional. I don't want to just drop this conditional in and wipe out the default VB code for that template.Comment
-
That means you do not have any Google Adsense in that template. You need to use the templates where your Google Adsense code is being used.Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
-
ok how would you disable adds for sertan member groups like 6 admins
would it be?
Code:<if condition="$membergroup != 6"> </if>
Comment
-
Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
-
So if I'm using Google Adsense Integration and it's set to "High" which template do I need to add this conditional to to stop ads from showing on specific forums?
<if condition="$forumid != X">
</if>
I'm sorry to be obtuse, but there appears to be no documentation in the manual showing either the built-in integration, or how the Ad Location Templates function.Comment
-
You would add this to whichever template contains your ad code.Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
Change CKEditor Colors to Match Style (for 4.1.4 and above)
Steve Machol Photography
Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.
Comment
-
-
Thanks, Jake...sorry it took me so long to get back to you.
Anyway...that seems to work, but I have multiple pages with Ad Sense in the header and footer that I don't want there...and this would mean I'd have to make several <if> statements surrounding the Ad Sense code.
It would seem the best thing for me to do would be to add an array, but I'm not quite sure how to code it.
Also, any page that is blocked by my robots.txt file or group permissions for guests...seems to cause issues with what content is displayed in the Google ads.
Can you recommend a better way for me to handle this? Pages like the memberlist, or who's online, or user profiles, etc., etc...are the ones where I basically get those service ads...instead of content relevant to the site.Comment
-
-
So if I'm using Google Adsense Integration and it's set to "High" which template do I need to add this conditional to to stop ads from showing on specific forums?
<if condition="$forumid != X">
</if>
I'm sorry to be obtuse, but there appears to be no documentation in the manual showing either the built-in integration, or how the Ad Location Templates function.
Code:<if condition="$GLOBALS['vbulletin']->adsense_pub_id"> <div style="width:728px; margin:0 auto; padding-bottom:1em"> <script type="text/javascript"><!-- google_ad_client = "{$GLOBALS['vbulletin']->adsense_pub_id}"; google_ad_host = "{$GLOBALS['vbulletin']->adsense_host_id}"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; google_ad_channel = ""; google_color_border = "$stylevar[alt2_bgcolor_hex]"; google_color_bg = "$stylevar[alt1_bgcolor_hex]"; google_color_link = "$stylevar[body_link_n_fgcolor_hex]"; google_color_text = "$stylevar[body_fgcolor_hex]"; google_color_url = "$stylevar[body_link_n_fgcolor_hex]"; google_ui_features = "rc:6"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </if>
So what you need to do, in your "Ad Location" templates, where you wish to ad the ad's is this:
Code:<if condition="$forumid != X"> <if condition="$GLOBALS['vbulletin']->adsense_pub_id"> <div style="width:728px; margin:0 auto; padding-bottom:1em"> <script type="text/javascript"><!-- google_ad_client = "{$GLOBALS['vbulletin']->adsense_pub_id}"; google_ad_host = "{$GLOBALS['vbulletin']->adsense_host_id}"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; google_ad_channel = ""; google_color_border = "$stylevar[alt2_bgcolor_hex]"; google_color_bg = "$stylevar[alt1_bgcolor_hex]"; google_color_link = "$stylevar[body_link_n_fgcolor_hex]"; google_color_text = "$stylevar[body_fgcolor_hex]"; google_color_url = "$stylevar[body_link_n_fgcolor_hex]"; google_ui_features = "rc:6"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </if></if>
Tell me if it workedMy Forums: The Geek District - Off Topic Hut
My Blog: Mikeylicious
Projects: Shorten URL's with kwn.meComment
-
I appreciate everyone's help. I've decided to go another route. Instead of using the low/medium/high settings, I've been dropping my Adsense code into the templates and saving to see where the ads show up. Not the most efficient method, but it works.
Now that I've done that, which conditional would I wrap around a particular ad to *only* have it display to one particular usergroup? I want to stick a third ad out there for just the unregistered group, but I can't find the documentation on that particular <if> statement. Is there a way to do that, or will I have to come at it the other way round and include the group numbers of the groups I don't want the ad to show to, like this?
<if condition="$membergroup != 6,7,8">
</if>Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment