Welcome to WebmasterWorld Guest from 3.234.214.113

Forum Moderators: martinibuster

How to do passbacks now?

     
5:05 am on Aug 8, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Mar 15, 2013
posts: 1205
votes: 120


I used to have my ad units set to passback to my own script when there wasn't an advertiser, but now I don't see it. I have the Ad Balancer set to 99/62, but it looks like they set up the Ad Balance but then took away my option to sell those $0 spots!

Or am I overlooking something somewhere?
2:08 pm on Aug 8, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


It was announced some times ago, that Adsense was in process of "simplifying" things : [webmasterworld.com...]

I believe that the removal of the backup ads is to impact other ads and affiliates networks :).

A trick, which is not that simple to set up, is to check the height of the ad slot, once all is done loading. Like that you can know if its collapsed or not. If collapsed, you can insert another code.
6:49 am on Aug 9, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Mar 15, 2013
posts: 1205
votes: 120


Sneaky! Sorta defeats the purpose of the Ad Balancer altogether, doesn't it? Sure, I can stop showing the Google ads that have no value... but I can't (easily) post anything else there, either 3:-)

I guess the easiest way to set up what you described (using pure Javascript) would be:

<div id="adsense_area">
// Adsense code here
</div>

// blah blah blah

<script>
var alternate_code = blah blah blah;

var interval = setInterval(function() {
if (document.readyState === 'complete') {
clearInterval(interval);

if (document.getElementById('adsense_area').clientHeight == 0)
document.getElementById('adsense_area').innerHTML = alternate_code;
}
}, 500);

</script>
</body>
</html>
10:34 am on Aug 11, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


Sorta defeats the purpose of the Ad Balancer altogether, doesn't it?

Yes :)

if (document.getElementById('adsense_area').clientHeight == 0)

I would do
if (document.getElementById('adsense_area').clientHeight < 32)

Because, under some conditions, the div's height might not be zero. So, in my opinion, this is safer to test for height smaller than 32 pixels.

I am not fan of timers. I prefer to use event listeners.
2:36 am on Aug 12, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Mar 15, 2013
posts: 1205
votes: 120


I'm not as well versed with event listeners... like this?


var alternate_code = blah blah blah;

document.addEventListener('DOMContentLoaded', (event) => {
if (document.readyState === 'complete' &&
document.getElementById('adsense_area').clientHeight < 32)
document.getElementById('adsense_area').innerHTML = alternate_code;
}
}
7:58 pm on Aug 12, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Mar 15, 2013
posts: 1205
votes: 120


Update: I tried that and it didn't work, so I'm missing something. No errors in the console, but this test did nothing, either:

document.addEventListener('DOMContentLoaded', (event) => {
if (document.readyState === 'complete')
alert('yes');
});


Using setInterval() worked, but I think that an event listener would use less resources. And if something gets hung up and the document never loads, the setInterval() could make things worse.

I did some research, and I suspect that the event had already fired by time the code got to this point. So this is my next test run, which I'll try later tonight:

var testLoaded = false;
if (document.readyState !== 'loading') {
altFunc();
}

else {
testLoaded = true;
document.addEventListener('DOMContentLoaded', altFunc);
}

function altFunc() {
if (testLoaded) { document.removeEventListener('DOMContentLoaded', altFunc); }

if (document.getElementById('adsense_area').clientHeight < 32)
document.getElementById('adsense_area').innerHTML = alternate_code;
}
8:28 pm on Aug 12, 2019 (gmt 0)

Junior Member

Top Contributors Of The Month

joined:May 1, 2018
posts: 112
votes: 18


"I tried that and it didn't work, so I'm missing something. No errors in the console, but this test did nothing, either: "

I think DOMContentLoaded doesn't wait until the javascript, images and css has loaded.. What about if you try the loaded event?

if(window.addEventListener){window.addEventListener('load', function(){altFunc();}, false);
}else if(window.attachEvent){window.attachEvent('onload', function(){altFunc();});}
function altFunc(){
if (document.getElementById('adsense_area').clientHeight < 32)
document.getElementById('adsense_area').innerHTML = alternate_code;
}
}

I also see something interesting by doing a few searches in regards to 'AdsLoadedEvent.ADS_LOADED'. Maybe this will work?

if(window.addEventListener){window.addEventListener('AdsLoadedEvent.ADS_LOADED', function(){altFunc();}, false);
}else if(window.attachEvent){window.attachEvent('AdsLoadedEvent.ADS_LOADED', function(){altFunc();});}
4:22 pm on Aug 13, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:2757
votes: 846


I think this is playing with fire.

The solution is to use AdManager. Typically I would say that it is far more complicated then backup ads but when you're at the point where you are listening for ad-load events, I think AdManager should be well within your grasp.

The fundamental difference between AdManager and the AdBalancer is that the AdBalancer suppresses AdSense impressions based on a relative measure (% of total impressions). Whereas, adManager works on a fixed price floor. The difference is that if on a given day the AdSense market is particularly weak, then the number of impressions of your back-up ads can end up being much higher than expected. One advantage is that in my experience the AdBalancer surpresses ads based on somewhat arbitrary factors likes geo-location and time of day. So backups tend to be very poorly targetted. With AdManager you have more control and can end-up showing you backup ads to a better audience.
3:02 am on Aug 22, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Mar 15, 2013
posts: 1205
votes: 120


Nick, I've tried to use AdManager in the past but it's soooo complicated, with 0 documentation! I've spent weeks upon weeks trying to get everything right, and still it's no good.

And I'm not sure if I can use in-feed or in-article with it, either. Or get it to pick the highest paying ad, like an Adsense responsive banner?

Either way, I'm having a new issue. What do I do when the ad spot is stretched out for a banner, but then nothing shows? I've been seeing a huge empty 600x300 spot all day. Looking at the console, I see this:

Uncaught SyntaxError: Unexpected token %

Since the height exists, any suggestions on how I can check to see if anything has loaded?
8:15 am on Aug 30, 2019 (gmt 0)

Junior Member

Top Contributors Of The Month

joined:Aug 30, 2019
posts:168
votes: 40


Hello-

I am interested in knowing how to use backup ads "again". Apparently, they've been discontinued one or two weeks ago.
8:22 am on Aug 30, 2019 (gmt 0)

Full Member

Top Contributors Of The Month

joined:Aug 3, 2015
posts:328
votes: 133


Use Ad Manager but it seems that most posters here aren't interested in it but it has a lot of functions that are helping me a lot for more revenue like direct sales, using other ads of affiliates and opening pages in a new tab when clicking an ad.
8:28 am on Aug 30, 2019 (gmt 0)

Junior Member

Top Contributors Of The Month

joined:Aug 30, 2019
posts:168
votes: 40


Hello Runfun-

My concerns about AdManager is that, its a Google's tool, and I suspect that Google is not giving a free tool for no reason. I believe that Google is using it to collect additional information, like for example, what kind of other ad networks you are using, or affiliate programs. It might not sound like a big deal, but Google never does thing for no reason, so I am sure there is or will be a backfire at some point. May be the removal of the backup ads from Adsense, is to push publishers to use the AdManager, and who knows what is Google's agenda about it.
1:35 am on Aug 31, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Mar 15, 2013
posts: 1205
votes: 120


@JorgeV, this is what's working for me. I have all of my ads wrapped in a DIV element with an ID of "block_" + an incremental number. So the first ad spot is wrapped in <div id="block_0">...</div>, the second is block_1, then block_2, and so on.

// at the bottom of the page
var interval = setInterval(function() {
if (document.readyState === 'complete') {
clearInterval(interval);
altFunc();
}
}, 500);

function altFunc() {
var block, blockHeight, m;

// I have a maximum of 6 ads on a page, so I check for block_[0-5]
for (m=0; m < 5; m++) {
block = 'block_' + m;

if (document.getElementById(block))
blockHeight = document.getElementById(block).clientHeight;

// if height is less than 50 then it's safe to assume nothing loaded
if (blockHeight < 50) {
// I have a function named "ajax", so this loads alt.php in "block_0" or whatever
ajax(block, 'alt.php');
}
}
}

As you've seen from my other thread, though, I have a lot of times where a banner won the bid and is trying to load, but doesn't for some reason. In those cases the height is set by Google, so this doesn't work. I haven't found a way to get around that yet, but I'm working on it.
1:55 pm on Aug 31, 2019 (gmt 0)

Junior Member

Top Contributors Of The Month

joined:Aug 30, 2019
posts:168
votes: 40


I have a lot of times where a banner won the bid and is trying to load, but doesn't for some reason. In those cases the height is set by Google

Are you sure this is not "blank ad" "above the fold"? Because Adsense is not collapsing these ads, but is still stuffing the slot with all kind of code, certainly for their tracking and stats system.
7:31 pm on Aug 31, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Mar 15, 2013
posts: 1205
votes: 120


I'm not sure at all... all I know is that I have a responsive banner plugged in, and sometimes I just end up with a 100% width, 280px height blank spot. It is always above the fold, though.

Which is SUPER annoying! My logo and navigation take up 160px, the address bar on Chrome takes another 70px, and the toolbar takes another 30px. So if the user has a 1024x768 screen then I have 508px for content. If a 280px banner loads then that's more than half of the remaining space, but at least I get paid for it. If it's blank, though, then that's half of the screen with literally nothing on it!

If they need to put in tracking code or something then that's fine, but I wish they would do it with 1px instead of 280px >:-(
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members