Forum Moderators: martinibuster

Message Too Old, No Replies

Most elegant way to put adsens onhold?

adsens HELP doesnt really does the job

         

cartone

10:24 am on Aug 11, 2006 (gmt 0)

10+ Year Member



I would like to put my adsense account on hold.
In that way that you don't see any advertising anymore on the page without changing anything on my htlm-tables.

Help tells me to remove my adsense account from the html pages, but that doesnt give good result.

any suggestiongs

IanTurner

10:44 am on Aug 11, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Write your adsense code into the page with a server side script.

Use a database flag to switch ads on and off.

frox

11:20 am on Aug 11, 2006 (gmt 0)

10+ Year Member



surely the best solution is to use a server side include.

this way, you will have a SINGLE file cntaining the ads, used by all your pages. Change that, and all pages will change!

Failing this, if you have many HTML pages, you can use a search-and-replace tool to search for

src="http://pagead2.googlesyndication.com/pagead/show_ads.js"

replacing it with

no_src="http://pagead2.googlesyndication.com/pagead/show_ads.js"

this will change the last part of your adsense script from:

<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

to:

<script type="text/javascript"
no_src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

which does absolutely nothing.

It's easy to switch them back later, doing the opposite operation.

PLEASE NOTE:
1) do a full backup of all your files
2) if you are validating your pages, they wouldn't validate anymore after
3) TECHNICALLY, this is "altering your Adsense javascript code", which is a no-no. But, this code won't be functioning anyway, so you would NOT be using this altered javascript, you would just have some broken code in your page.

You definitely should ask adsense support if they find it's ok.

This said, it would be a simple but very useful thing for Google to provide an account-level switch:

- Ads are active
- Ads are PSA
- Ads are off

cartone

12:32 pm on Aug 11, 2006 (gmt 0)

10+ Year Member



Thx for the no_src tip. It did the trick.

I have a revenue of 10 dollar/day but for the moment the adds are blocking my business

frox

12:44 pm on Aug 11, 2006 (gmt 0)

10+ Year Member



You are welcome!

As I said, ask adsense support if it's ok.

fredw

5:08 pm on Aug 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wow. Of all the ways you could possibly modify a site to stop showing Google ads, modifying the Google code (even though it results in code that doesn't show Google ads) would be the last method I'd try.

Google is very sticky about modifying their code in any way.

greatstart

5:19 pm on Aug 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What about doing this:

<!--

Your Google AdSense Code Here

-->

Chapman

6:10 pm on Aug 11, 2006 (gmt 0)

10+ Year Member



I echo fredw's "Wow"... modifying Google's code would be the last thing I'd consider as a safe solution as well.

I've seen a number of seemingly benign code modifications presented to ASA and the answer was always a resounding NO!

Since no ads are being generated perhaps this would be an exception but I'd want a statement from tech support before I went live with it. I sure would be concerned about myopic-algo-processing bots crawling around and finding that modification in my ads.

I'm not sure the solution provided by greatstart is going to be completely effective as the '<!--' code is going to be canceled out with a '-->' that is inside the AdSense code. This appears to eliminate the ads by submitting an "empty" ad (sans any ad information) to pagead2.googlesyndication.com/pagead/show_ads.js. The submission is still made non-the-less which may be another issue.

You'd have to use two sets of '<!--' '-->' codes for this to work but again you'd have to modify Google's code to do it.

Chapman

[edited by: Chapman at 6:11 pm (utc) on Aug. 11, 2006]

frox

6:25 am on Aug 12, 2006 (gmt 0)

10+ Year Member



I've seen a number of seemingly benign code modifications presented to ASA and the answer was always a resounding NO!

I thought the same until I saw the thread on js changes for A/B testing.

Anyway, yes, I reccomend to ask Adsense support!

What I have done in other cases is changing
<SCRIPT>
</SCRIPT>
into
<NO_SCRIPT>
</NO_SCRIPT>

thus transforming javascript in a useless tag. The fact is, this is not easy if you have other javascripts in your code: all your javascripts will be broken!

bumpski

1:45 pm on Aug 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[webmasterworld.com...]

In the thread above you will find some Javascript code that can dynamically disable any Adsense Script without altering the Adsense code in any way. The trick is adding a "dummy script" with a well known name in front of every Adsense script and of course some additional Javascript. The sample code finds the "dummy" script and then "disconnects" the Adsense code that follows the dummy from the page. This is just example code or an outline of how it can be done. I have tested this successfully. I do think this qualifies as an "elegant" method which does not touch the Adsense code at all.

Conceivably you could place six copies of Adsense code on one page as long as you only "executed" three at a time and still meet the TOS, BUT, Adsense might still can you anyway, so be careful!