PDA

View Full Version : adsense hide on error pages


matrog
03-12-2014, 07:23 PM
Hi All, google adsense is banning my account since they don't want to display ads on error or empty pages, how can I prevent this using come conditional statement in my pages?

thanks,
matteo

bzcomputers
03-12-2014, 09:14 PM
Hopefully you can get this fixed quickly. A lot of people miss the fine print and get banned this way.

Per Google:
Google ads, search boxes or search results may not be:


Integrated into a software application (does not apply to AdMob) of any kind, including toolbars.
Displayed in pop-ups or pop-unders.
Placed in emails, email programs, including webmail, or on pages where dynamic content (such as live chat, instant messaging, or auto-refreshing comments) is the primary focus. (Does not apply to AdMob.)
Placed in emails, email programs, or chat programs. (Does not apply to AdMob.)
Obscured by elements on a page.
Placed on any non-content-based page. (Does not apply to AdSense for search, mobile AdSense for search, or AdMob.)
Placed on pages published specifically for the purpose of showing ads.
Placed on pages whose content or URL could confuse users into thinking it is associated with Google due to the misuse of logos, trademarks or other brand features.
Placed on, within or alongside other Google products or services in a manner that violates the policies of that product or service.


The code below will keep your ads off of vBulletin "non-content based pages" including error pages, starting a new thread page, registration pages, site rules, etc. and keep you in compliance with Google Adsense rules.

<vb:if condition="!in_array(THIS_SCRIPT, array('error', 'misc', 'newthread', 'private', 'register'))">
YOUR AD CODE HERE
</vb:if>


P.S. The "error" conditional above may not be the same for everyone depending on if you use the standard vB error pages or a mod to display error pages. To verify, check the source code of the error pages displayed by your particular installation and adjust the conditional as necessary to cover your script.

If you can't figure it out yourself, just post or pm a link to your site.

MYU
03-13-2014, 12:07 AM
Hello, I'm having the same problem. I had a news section which was breaking Adsense rules, I've deleted the section and it comes up with an error page now.

http://www.wearetherangersboys.com/forum/showthread.php?161554-Men-jailed-in-teen-sex-slave-case

I used the code above and the banner don't display on the page to register, however it still shows on the link above.

I'm using a test style to test it and I don't want the ad on some sections of the forums.

If you go into the default style the ads will not show on this error page. I have set that so it only shows on the forums I want, it will not display on global which is what I want. It's also set as non content.

I want my ads global, not to show on a few sections or non content pages if anyone can help?

matrog
03-13-2014, 07:20 AM
thanks, your code works for the majority of non content pages except this one for example

http://www.digital-forum.it/showthread.php?15902-saluti-dagli-usa/page5

thanks,
Matteo

bzcomputers
03-13-2014, 08:37 AM
... I've deleted the section and it comes up with an error page now.

http://www.wearetherangersboys.com/forum/showthread.php?161554-Men-jailed-in-teen-sex-slave-case


thanks, your code works for the majority of non content pages except this one for example

http://www.digital-forum.it/showthread.php?15902-saluti-dagli-usa/page5

thanks,
Matteo

Both of these links are threads that use the script 'showthread'. If you put that in the above code it will stop ads from displaying on all your forum threads. You really need to just permanently delete reference to those old threads/links.

MYU
03-13-2014, 01:11 PM
Both of these links are threads that use the script 'showthread'. If you put that in the above code it will stop ads from displaying on all your forum threads. You really need to just permanently delete reference to those old threads/links.

Thank you, problem is this link is from Google search.

My news section had over 200,000 threads which is all deleted now. These links are found on Google search and displays this page.

Surely the forum will know it's a non content page as it's displayed on the screen?

bzcomputers
03-13-2014, 08:55 PM
Thank you, problem is this link is from Google search.

My news section had over 200,000 threads which is all deleted now. These links are found on Google search and displays this page.

Surely the forum will know it's a non content page as it's displayed on the screen?

It appears you must be using either a mod or individual rewrite rules on your threads. The page that is resulting from the removed link you posted should be giving an error so Google knows to remove it (eventually), check your mod settings or your rewrite rules.

ForceHSS
03-13-2014, 09:04 PM
Adsense always disabled my account no matter how many i added so i found a way around it. Add it to youtube first leave it running for a few months then add it to your forums have had it running now a few years and so far so good

bzcomputers
03-14-2014, 12:02 AM
I currently use a combination of these two mods to get the results I needed and have never had any warnings/issues with Adsense:

1) DBSEO (https://vborg.vbsupport.ru/showthread.php?t=308615) - previously used vbSEO
2) vb4 Error Pages (https://vborg.vbsupport.ru/showthread.php?t=281410)

When setup correctly all removed deleted threads/urls which contain no content give a 404 Custom Error Page which does not display any Adsense ads.

After awhile Google will remove the urls leading to the 404 Error Pages from their search engines. In the mean time you will be complying with Google's Adsense rules by just keeping ads off of the non-content 404 Custom Error Pages by using the code I posted above.

MYU
03-14-2014, 09:28 PM
I currently use a combination of these two mods to get the results I needed and have never had any warnings/issues with Adsense:

1) DBSEO (https://vborg.vbsupport.ru/showthread.php?t=308615) - previously used vbSEO
2) vb4 Error Pages (https://vborg.vbsupport.ru/showthread.php?t=281410)

When setup correctly all removed deleted threads/urls which contain no content give a 404 Custom Error Page which does not display any Adsense ads.

After awhile Google will remove the urls leading to the 404 Error Pages from their search engines. In the mean time you will be complying with Google's Adsense rules by just keeping ads off of the non-content 404 Custom Error Pages by using the code I posted above.

I will try this and thank you for your help.

mykkal
06-19-2015, 06:33 AM
Does anyone know how to block ads from appearing on specific threads?