homepage Welcome to WebmasterWorld Guest from 107.20.131.154
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Google / Google AdSense
Forum Library, Charter, Moderators: incrediBILL & jatar k & martinibuster

Google AdSense Forum

    
Improving Page Load Time
When using AdSense
trillianjedi




msg:3025596
 10:55 am on Jul 28, 2006 (gmt 0)

I have had a few users complain over the last year or two that the AdSense ads on pages of one of my sites in particular cause the page load times to be "quite dramatically" slowed.

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

 

pageoneresults




msg:3025640
 12:17 pm on Jul 28, 2006 (gmt 0)

SOC for sure! I've been using this method for years and it performs without fail. I typically drop all content such as AdSense at the bottom of the html. I learned years ago that SOC improves the user experience and also makes for a nice clean indexing. ;)

celgins




msg:3025650
 12:31 pm on Jul 28, 2006 (gmt 0)

Thought about using SOC some time ago, but I have an old website with too many pages that would need changing.

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.

pageoneresults




msg:3025664
 12:37 pm on Jul 28, 2006 (gmt 0)

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.

trillianjedi




msg:3025666
 12:37 pm on Jul 28, 2006 (gmt 0)

Yeah I figured that may be the best/only way, I'm just source ordering content and nav already and I'm not sure that I can squeeze everything else in, in the places that I need it.

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

bumpski




msg:3025669
 12:42 pm on Jul 28, 2006 (gmt 0)

There was a time when IFrames solved this problem, but when Adsense introduced the "section" start and end directives (section targeting), they made IFrames unreliable. It is likely you will have untargeted ads if you try IFrames. (For some, IFrames still seem to work, I don't understand why.)

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?

celgins




msg:3025678
 12:46 pm on Jul 28, 2006 (gmt 0)

With SOC, you need not worry about it as it is the last thing on the page that loads.

I'll change a dozen or so pages and check it out.

Hobbs




msg:3025709
 1:06 pm on Jul 28, 2006 (gmt 0)

This leads to an interesting appearance (corrupted) for pages in the Google cache

I've disabled Google's caching my pages a month back, was scary in the beginning but all is well with no repercussions so far.

Erku




msg:3025723
 1:12 pm on Jul 28, 2006 (gmt 0)

pageoneresults

are you using DHTML method?

pageoneresults




msg:3026008
 4:13 pm on Jul 28, 2006 (gmt 0)

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.

graywolf




msg:3026098
 5:01 pm on Jul 28, 2006 (gmt 0)

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?

jimh009




msg:3026140
 5:20 pm on Jul 28, 2006 (gmt 0)

> 1. Source ordered content

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

amznVibe




msg:3026225
 6:07 pm on Jul 28, 2006 (gmt 0)

If google would only let us change the code and use "DEFER" we could fix all page loading time issues in a heartbeat.

trillianjedi




msg:3026240
 6:21 pm on Jul 28, 2006 (gmt 0)

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

rohitj




msg:3026263
 6:39 pm on Jul 28, 2006 (gmt 0)

Can't you ask google if a modification is ok? Or do they just give you a cookie-cutter run-around?

rebelde




msg:3026497
 9:06 pm on Jul 28, 2006 (gmt 0)

It looks like I will be outvoted on this one, but I've been using Iframes with very good results. If AdSense (or other network) is delayed or unavailable, my pages still load well. The ads also are matched well to the content. (I haven't tried the section start/end directives.)

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

annej




msg:3026589
 10:18 pm on Jul 28, 2006 (gmt 0)

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.

leadegroot




msg:3026706
 12:10 am on Jul 29, 2006 (gmt 0)

Source Ordered Content - basic SEO tactic employed

Just FTR, this is also a tactic that can improve accessability, not just SEO :)

Hanu




msg:3026934
 6:44 am on Jul 29, 2006 (gmt 0)

I have a question. The users who are experiencing the slow page load, are they by any chance using IE?

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.

bumpski




msg:3027262
 4:34 pm on Jul 29, 2006 (gmt 0)

This is an interesting Adsense topic. Rebelde and I have discussed IFrames before and have different results. One difference, perhaps, for my lack of success, was having the Adsense code before the page content; this was not a problem when I first used IFrames, but they did stop functioning well for me. Now that I've relocated the code beyond the content, and in doing this wrapped the pertinent content with section start and end directives, conceivably I could again use an IFrame to assure completely asynchronous loading of the Adsense Ads. I'm not sure the DIV always does it.

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);
};
};
};

The code above dynamically detaches the Adsense code script that follows a dummy script called BHTDS-BHTUL5L. "BHTSCRelementDis2" points to the one block of Adsense code. If these dummy scripts were sprinkled around your pages whereever you might need ads, conceivably you could dynamically "reattach" the code to execute whereever you want it too on the page. I've used this code to dynamically disable more than one Adsense ad on a page. This allows me to achieve this goal without altering Adsense code at all! (I haven't done extensive testing however).

This discussion is very pertinent to the Adsense topic, since it is the Adsense code, performance, and TOS that mandate elaborate coding schemes.

bumpski




msg:3027296
 5:17 pm on Jul 29, 2006 (gmt 0)

Regarding dynamic code execution in my last post, I've had second thoughts. The goal was to dynamically locate the code not execute it, which my comments don't really help with. (It was too late to edit)

AjiNIMC




msg:3028290
 12:53 am on Jul 31, 2006 (gmt 0)

to get good revenue it should be placed towards the starting. I do not know how optimize will be a css based desiging where the code keeps it towards the bottom. I will certianly not go for iframes.

I find adsense's loading speed ok.

jetteroheller




msg:3028431
 4:52 am on Jul 31, 2006 (gmt 0)

Not the total page load time is important.

The load time to first useable content.

So the main content of my sites comes first.

After this comes the navigation.

For load times very important is to use only static pages. All pages are generated by my CMS on my computer and uploaded as static pages.

david_uk




msg:3028460
 6:05 am on Jul 31, 2006 (gmt 0)

I'd like to try the SOC route with the adsense code at the bottom. But I'm a complete numpty with CSS. Can anyone post any url's to help us people who haven't yet explored this area?

Thanks

trillianjedi




msg:3028529
 8:42 am on Jul 31, 2006 (gmt 0)

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

wmuser




msg:3030663
 8:52 pm on Aug 1, 2006 (gmt 0)

Nice suggestions,i have received such a complaints from users in past as well as i have catched it myself

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google AdSense
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved