vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Block Google Adsense Ads on Error Pages & More by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=326045)

BirdOPrey5 01-30-2018 10:00 PM

Block Google Adsense Ads on Error Pages & More by BOP5
 
1 Attachment(s)
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. :)

BirdOPrey5 01-31-2018 03:56 PM

Reserved.

Alan_SP 01-31-2018 05:07 PM

Quickly tested, everything works as it should, ads are blocked.

djbaxter 02-01-2018 11:01 AM

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?

BirdOPrey5 02-01-2018 04:35 PM

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.

unitedpunjab 02-10-2018 04:01 AM

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 ?

kai_sey 03-21-2018 02:59 PM

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!

spipo 03-22-2018 05:14 PM

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

BirdOPrey5 03-29-2018 05:37 PM

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

kingMOB 06-21-2018 12:20 AM

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?


All times are GMT. The time now is 02:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01355 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete