tags:

views:

366

answers:

1

The google ad manager help site is pretty prescriptive about how the calls to their Javascript API need to be made and how combining blocks of javascript calls could cause code to break.

(http://www.google.com/admanager/help/en_US/tips/tagging.html)

I don't really like the idea of inserting so much JS in the head of my pages. I would prefer it to be inserted at the bottom of the page and wrapped in a document.ready() call.

Have others had any success moving away from the very specific way that Google prescribes?

TIA

Pat

A: 

Have done the move with the Google Ad section outside of HEAD and just in the BODY part itself. Really doesn't make a difference since when it was moved, it was just right after the parameters used for the ads to display.

Probably has more to do with trying to have the script loaded before the necessary hooks on the page want to try and call or use any of the functions included in the script file.

From the tagging guide you mention:

JavaScript tags occur out of sequence

This error indicates that calls to Ad Manager JavaScript functions do not occur in the proper sequence. This error may prevent ads from appearing. It may also cause Ad Manager to fetch the wrong ads; for example, if you fetch ads for the page before specifying page-level attributes for the page, you may fetch ads that do not factor in the targeting criteria.

This may be why they're trying to be prescriptive about where to place the code.

random