homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Google / Google AdSense
Forum Library, Charter, Moderators: incrediBILL & jatar k & martinibuster

Google AdSense Forum

Problem implementing Asynchronous Ad Units

 8:41 pm on Feb 13, 2014 (gmt 0)

We use adsense synchronous ad units on a site I'm involved in without any issue. Only 3 units per page. Site has a set of (3) major pages which are dynamically generated.

One 2 of the three, we changed to asynchronous ad units and found the following

Page 1 (only 1 ad unit) - does not appears - switch back to synchronous and ad units immediately start appearings

Page 2 (only 2 ad units). 1st ad unit shows ads but 2nd does not. When switching back to synchronous - both units show ads.

We've waited several hours with no change in this behavior. Checked the browser console and no evident errors are found.


Sally Stitts

 8:51 pm on Feb 13, 2014 (gmt 0)

I keep reading stuff like this.

There are benefits to being a late adapter.
Experience has made me a VERY late adapter.
I tried the synchronous ads earlier - there were various issues.
Maybe I will try them again ... next year.


 9:03 pm on Feb 13, 2014 (gmt 0)

I have found that if you are using the responsive code, you have to define at least a max width and height for the div that the ad code is located in.

Sometimes, I only have to define one, sometimes both. I have not found a rhyme or reason why yet. But if the div the code is located in is nested in other divs that determine the size of that div, the ad will not appear.


 9:16 pm on Feb 13, 2014 (gmt 0)

We are using old html 4.01 transitional - fixed tables, etc.

Everything checks out on W3C, etc.

One page 2 - the one asynch ad unit that appears is in a nested table
<table><tr><td><table><tr><td>Adsense Code</td></tr></table></td></tr></table>

The second on the page is the same scenario but the ad unit will not appear. Switching back to synchronous works fine for both.


 9:57 pm on Feb 13, 2014 (gmt 0)

For a little while there I was not seeing my asynch resp ads showing up on the first page load. Refreshing the page then made them show up. I have not seen that problem, however, in at least a month.

Did you try refreshing the page right after it doesn't load? In my case that caused the ads to appear. If so, then you have the same problem I had.


 10:03 pm on Feb 13, 2014 (gmt 0)

On page 1 - the ad unit (1 of 1 on the page) never appears. Multiple browsers, different systems

Page 2, the top ad unit always appears. Only the second ad unit does not - same story..multiple browsers and different systems.


 10:08 pm on Feb 13, 2014 (gmt 0)

I've also seen new asynchronous ad units take forever to kick in (several hours). And there is definitely something to declaring the size of the container. The cool thing is you can create custom ad sizes this way by proportioning your container div. Not sure how sizing impacts ads in tables but it's easy enough to put a div inside the table cell to find out.


 10:46 pm on Feb 13, 2014 (gmt 0)

Page 2, the top ad unit always appears. Only the second ad unit does not

This has been my experience when not defining the size of the container. And might likely explain the need to define either one or both.

It really does not make sense that it would be able to figure one out but not the other, but I am only a hack programmer - so I don't know much. Seriously, try defining the container, which in your case would be the table cell. I think you will find it fixes the problem.


 11:52 pm on Feb 13, 2014 (gmt 0)

We are using old html 4.01 transitional...

Might help. Might not. Just throwing this out there. Try eliminating the Document Type Declaration as a suspect if 4.01 is the DTD in your head section. That DTD is an older one that can sometimes negatively affect the way code displays. Try this and see if anything breaks:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">


 12:46 am on Feb 14, 2014 (gmt 0)

Make sure the word "file" has not inserted itself into the adsense code once you paste the code into the page and then save the page. I have to edit the page in notepad, remove the word "file" and then save the page to get the asynch code to work. Very annoying.


 1:38 am on Feb 14, 2014 (gmt 0)

Tried to change the doc type on the temp page - no effect....

Also nothing with file.

As mentioned - on page 2, the top ad displays - just not the 2nd one. If reverting back to synch code - everything shows up immediately


 1:56 am on Feb 14, 2014 (gmt 0)

@HollyWMarshall I don't see that you mentioned actually trying to size your table cell as people suggest so how do we know you don't already have a viable solution in your hands.

The following piece of code (according to some but not verified by Google as an approved modification) may actually be redundant on the page. Try removing it from your second unit and see if that helps. With two units, you're essentially loading the same script twice.

<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

 2:35 am on Feb 14, 2014 (gmt 0)

Yes - tried adding a width to the td under the table and also a width="100%" to that table. Also tried adding a sized <div> under the td and put the adsense in that. All along with combination various of above to no effect.

Also tried removing the code you mentioned above on the 2nd ad unit. With or without. 1st ad unit shows fine but not the second. Go back to sync and they both appear. :(


 3:48 am on Feb 14, 2014 (gmt 0)

I would suggest using css to set your widths. e.g.

style="width:468px; height:60px;"

rather than width="whatever" and also try setting both width and height. Does make one wonder if doctype has something to do with this though. Another question would be "are you using a fixed ad size or smart sizing?" I use smart sizing but I'm also using HTML5. Like martinibuster mentioned 4.01 is an older doctype but maybe just employing css instead of the deprecated width attribute can do some good. Might be pertinent to change the attribute and doctype together to see what happens.


 12:14 am on Feb 16, 2014 (gmt 0)

I also have to ask a rather obvious question here. Are you using the same ad code in more than one place on the same page or is each unit on the page a a different unit with a different ID? I use all different units on each page so wouldn't see a problem caused by using the same unit multiple times on the page but it's worth asking. This could be a source of problems for some people. Who knows?


 11:58 pm on Feb 25, 2014 (gmt 0)

Ok - with Google Engineer's help and our own investigation - figured what was causing the issue. The some special characters that are in the async adsense code but not in the sync were being stripped by the template system of the site. The reason one ad unit would show and not the other is one ad unit by passed the template system and the other did not by the way there were inserted into the code.

All seems to be working great now.


 3:44 am on Feb 26, 2014 (gmt 0)

Thanks for sharing the solution! Is this a common CMS or was it created specially for you?


 4:04 am on Feb 26, 2014 (gmt 0)

Any PHP CMS that uses {...variable...}


 11:29 am on Feb 26, 2014 (gmt 0)

Thanks for posting this, Holly. Always good to know what can potentially go wrong. :)

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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved