Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Block Google Adsense Ads on Error Pages & More by BOP5 Details »»
Block Google Adsense Ads on Error Pages & More by BOP5
Version: 2.0.0, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.x.x Rating:
Released: 01-30-2018 Last Update: 03-28-2018 Installs: 12
Supported Uses Plugins
Re-useable Code  

Brought to you by BirdOPrey5.com. (Formerly Qapla.com)

I have been made aware that vBulletin 3 and 4 Administrators who use Google Adsense ads in positions like the header, navbar, and/or footer are getting warnings from Google that ads are appearing on error pages (such as "No Permission" pages) which lack any real content, in violation of Adsense Terms of Service. Google threatens to suspend your Adsense account if this is not fixed.

Put simply this mod attempts to kill Adsense ads from loading in the easiest possible way.

When an error page is detected the plugin will search for the code "adsbygoogle.js" which all current Adsense ads call on to load. If found it will delete the filename so the file is never called by the browser and never loaded on the page, thereby preventing the Adsense Ads from showing.

If you find it useful please consider making a donation using the Support Developer option to the right of this post, below my avatar. :up:

There are no real instructions and no options. Install the mod from Product Manager in the Admin CP and it is active. Disable the mod from Product Manager to turn it off or uninstall it to remove it. No permanent changes are made to your site or files.

This only works for Google Adsense. If there is demand I may be able to block ads from additional sources if you can provide me with sample ad code for those ad providers.

Should work on just about all versions of VB 3.8.x and 4.x.x and PHP 5 and 7 currently available. Tested on VB 4.2.5 and PHP 7.0.x.


2.0.0 Update

As of version 2.0.0 released 29th March 2018 you can now also specify a list of pages on which to block ads by going to Admin CP -> Settings -> Options -> Block Adsense Ads on Error Pages & More by BOP5. By default register and sendmessage (the Contact Us page) are on the block ads list.

------------------------------------------------------

Please "Mark as Installed" if you use this.

Download Now

File Type: xml product-bop5blockadserrorpages.xml (1.4 KB, 20 views)
File Type: xml product-bop5blockadserrorpages_v2.xml (2.9 KB, 36 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
Alan_SP, In Omnibus

Comments
  #2  
Old 01-31-2018, 03:56 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reserved.
Reply With Quote
  #3  
Old 01-31-2018, 05:07 PM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quickly tested, everything works as it should, ads are blocked.
Reply With Quote
Благодарность от:
BirdOPrey5
  #4  
Old 02-01-2018, 11:01 AM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works just fine out of the box on error pages.

What about pages like Settings or Private Messages? Shouldn't those also be blocked, technically?
Reply With Quote
  #5  
Old 02-01-2018, 04:35 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Private Messages are content. It doesn't need to be public content to qualify to have ads. But the settings pages, registration pages, some others, probably could be added.
Reply With Quote
Благодарность от:
djbaxter
  #6  
Old 02-10-2018, 04:01 AM
unitedpunjab unitedpunjab is offline
 
Join Date: Feb 2006
Location: Scotland
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a feature request.

Starting February 15 " Chrome will remove all ads from sites that have a "failing" status in the Ad Experience Report"

https://developers.google.com/web/up.../12/better-ads

One of the violation is "30%" rule.

https://www.betterads.org/mobile-ad-...igher-than-30/

I am worried about threads with short single posts.

Could it be possible to remove ads on threads with thin content ?
less than x words ?
Reply With Quote
  #7  
Old 03-21-2018, 02:59 PM
kai_sey kai_sey is offline
 
Join Date: Nov 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this mod - nice to see some awesome coders here still supporting vb3.8x.

Any chance you can also incorporate the sendmessage.php page into your mod to disable Adsense there?

Since, I just got an email from Google telling me:
Quote:

"This is a warning message to alert you that there is action required to bring your AdSense account into compliance with our AdSense program policies. We've provided additional details below, along with the actions to be taken on your part... Example page where violation occurred: https://www.domain.com/forums/sendmessage.php

Action required: Please make changes immediately to your site to follow AdSense program policies.
Would really appreciate it!
Reply With Quote
  #8  
Old 03-22-2018, 05:14 PM
spipo spipo is offline
 
Join Date: Mar 2006
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it doesnt works on vb 4 . i can still see adsense showing on deleted posts

edite : Sorry . it works fine . juts I had adsense integrated with DFP . so it doesnt included that code . so i changed it with another 'name'


BTW : anyway to integrate this plugin with other pages : like /sendmessage.php /private.php ..ect ?


Thanks
Reply With Quote
  #9  
Old 03-29-2018, 05:37 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Version 2.0 released, allows blocking of specific pages using their THIS_SCRIPT constant. Setup to block by default on register and sendmessage pages. (sendmessage is the "contact us" page.)

If this mod is helping your site place consider making a donation using the "Support Developer" link below the Avatar in the first post.
Reply With Quote
2 благодарности(ей) от:
Alan_SP, djbaxter
  #10  
Old 06-21-2018, 12:20 AM
kingMOB kingMOB is offline
 
Join Date: Nov 2007
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks BirdOPrey5.

Any chance of expanding the plugin and include DFP and an option to block ads before some date based on the last post of a thread?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05570 seconds
  • Memory Usage 2,334KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (6)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete