Forum Moderators: martinibuster
I experienced this myself when there seemed to be some intermittent Google server outages yesterday. I now fully understand what these users are trying to explain to me.
What can be done about this? I've been giving it some thought and can't really get beyond about three possibilities that might actually work.
1. Source ordered content
Pull the AdSense code last and position with appropriate CSS DIV markup. I'm not sure that's all easy in my particular case as I'm using a full float CSS layout already which is probably pushing the margins of what is currently possible. I don't know that it would stand any additional complexity.
2. iFrames
I'm not sure that this would work as mediabot would then be crawling a blank page URL? Is it possible to call the AdSense code inside the main page but direct output to an iFrame?
3. DHTML
Something I've been playing around with recently. This would work in the same was as source ordered content, but the DIV's would actually be referenced in their natural place in the source, and the AdSense code pushed into that space when it's loaded.
I don't know if that's workable? As far as I can ascertain, there is no hook into an OnLoad event that could be tapped into?
What would be nice here, although again I'm just not sure if it's possible, would be to use the Body.OnLoad event so that the AdSense code is not called until the page has finished loading, then it's all called at once and shoved into the appropriate DIV slots.
Anyone here playing with this or have a succesful working solution?
TJ
Besides that, I've noticed that the slow down seems to be due to the Javascript process that retrieves and shows the ads.
Not sure there is a way to get around that... especially when there may be intermittent Google pauses.
Besides that, I've noticed that the slow down seems to be due to the Javascript process that retrieves and shows the ads.
The slowdown will cause anything after the JavaScript code to be delayed until the AdSense loads. With SOC, you need not worry about it as it is the last thing on the page that loads. Everything else will load first and then the user has a full page while the AdSense loads and appears when finished.
I have one set of adsense underneath the nav bar which is source-ordered at the foot of the page (so no problem), but I also have AS inserted into forum threads, which are table based.
Is there any way that I can have the forum AS code at the foot of the page, but shove it into a DIV inside a table residing above it? Consider if my post here had AdSense just below it.
I can't think of any way to do that and keep the liquid layout.
Perhaps I should move this thread into the CSS forum....
TJ
It's funny when IFrames did work you would get targetted ads even in the Google cache, and the performance problems were solved.
For some sites I now have the Adsense code at the end of the page and use a DIV to place the ads where I want them. This leads to an interesting appearance (corrupted) for pages in the Google cache.
Don't forget the Adsense Javascript itself must be loaded even before Google starts to produce the Ads.
I've always wondered whether a "link rel" directive might expedite loading this code?
are you using DHTML method?
No. I've never had the opportunity or need to work with DHTML.
My AdSense code sits right before the closing </body> tag. Right where it should be. ;)
P.S. As a side note, this not only pertains to AdSense. Any third party JavaScript that makes a call off site is going to cause issues with your page performance.
Anyone remember back to the WPG days and their tracking script? There were times when that thing would hang for minutes.
My AdSense code sits right before the closing </body> tag. Right where it should be.
I use section targeting to tell adsense to only look at the main body and not the navigation. I put the adsense code inside of the section targeting. Has anyone tried putting the adsense code outside of the section targeting and were there any negative side effects?
OK. Stupid Question.
How does one go about putting the javascript for the adsense code on the bottom of the page?
I run Adsense on the left side navigation bar. As such, when Adsense died the other day, none of my content showed.
So...how can I move that adsense code down to the bottom, without messing up the page layout?
Thanks.
Jim
How does one go about putting the javascript for the adsense code on the bottom of the page?
Source Ordered Content - basic SEO tactic employed as a means of putting important content at the top of the page source, less important content/fluff at the bottom of the page source, and using CSS to direct DIV positioning to the browser.
As we're in the AdSense forum I don't propose to go into great detail on the CSS side of this. That's essentially the gist of it. There's a few threads in the CSS forum library.
I run Adsense on the left side navigation bar. As such, when Adsense died the other day, none of my content showed.
You could put the entire nav bar and AdSense code at the very bottom of the page source as pageoneresults and put it in a DIV to ensure it renders in the right place.
I'm still convinced there's a better way. I'm already doing SOC for 3 col fluid source-ordered layouts and I'm convinced that I can't introduce the JS script calls in the right place without breaking what I have already in one browser or the other.
right before the closing </body> tag. Right where it should be.
Amen brother ;)
TJ
Testing the Iframe solution is pretty easy. Copy one of your pages, but put the AdSense code in a page in an Iframe a few pixels larger than the ad unit. Load your page from a browser. Google usually fetches that page from the server immediately, and you will soon see relevant ads. At least that is how it works for me...
If google would only let us change the code and use "DEFER" we could fix all page loading time issues in a heartbeat.
I wish Adsense would do something like that in their code rather leave it to webmasters to each work out some sort of fix. It really is a concern especially for those of us who still have visitors using dial-up.
My AdSense code is in a fixed-size div at the beginning of the page source, close to the opening body tag. Now, whenever I view my site in FireFox, the page loads very fast hanks to an highly optimized site on a dedicated server. It might take a while until the adsense JS code fetches the ads, though. Until that's done the ad div is empty. But it never delays the loading of the page. Why would it? The div is of a fixed size and so the browser can go ahead and lay the page out even though the div's content is not yet known. The AdSense JS runs asynchronously to the page loading, right?
I seem to think this is another IE quirk.
I'm still convinced there's a better way. I'm already doing SOC for 3 col fluid source-ordered layouts and I'm convinced that I can't introduce the JS script calls in the right place without breaking what I have already in one browser or the other.
trillianjedi
I'm convinced you can dynamically locate the code. One method is to put Named Marker dummy scripts throughout your page everywhere you might like the code to execute. Then the code can be dynamically attached (inserted) after the appropriate dummy script markers.
var BHTSCRelements;
BHTSCRelements = document.getElementsByTagName("Script");
for (var i = 0; i < BHTSCRelements.length; i++)
{
if(BHTSCRelements[i].id == "BHTDS-BHTUL5L")
{
var BHTSCRelementDis1 = BHTSCRelements[i+1];
var BHTSCRelementDis2 = BHTSCRelements[i+2];
if( BHTSCRelementDis2 )
{
BHTSCRelementDis2.parentNode.removeNode(BHTSCRelementDis2);
};
};
};
This discussion is very pertinent to the Adsense topic, since it is the Adsense code, performance, and TOS that mandate elaborate coding schemes.
Not the total page load time is important.The load time to first useable content.
That depends on the design of the site and existing markup.
For load times very important is to use only static pages.
That is not correct - it makes absolutely no difference to AdSense load times whether your pages are static or dynamic. The moment the AdSense JS file is executed the page load will stall waiting on Google, not your server.
David - for the CSS side of this, and SOC, start in the CSS forum library.
TJ