Website performacne. Move the ad download feature (GA_googleFillSlot) at the bottom of the page.

I am using a method GA_googleFillSlotfrom the Google Ad Service to download ads. Which should be loaded on the right rail of the page on my website.

As part of speeding up my website, I want to move the method with the appropriate javascripts at the bottom of the page. The javascript method creates a new div with id google_ads_div_<name of ad slot>and ad content.

Since the advertising div is located at the bottom of the page, I need to move the div to the right place (inside the parent div, the right rail of the site div). Here, even if the div and javascript files are moved to the parent div, the contents of the iframe body in the div are missing.

I tried to use the following prototype methods for moving content into the parent div div: insert, appendChild,replace

I am not very familiar with javascript, please advise me if I am wrong? Any help is appreciated.

+3
source share
3 answers

This is the best answer I've seen so far: http://www.google.com/support/forum/p/Google%20Ad%20Manager/thread?tid=7bcfaa482259cc28&hl=en

This is definitely not ideal, as it relies on absolute positioning rather than loading, but it looks like the Google Ad javascript code is not compatible with onload. This is a real pain.

+2
source

DOM, document.write(). document.write(), () . : CSS DOM , . .

AdSense, . , Google.

+1

onload . , DOM javascript, , .

javascript- jQuery,

jQuery(document).ready(function() {
  // code for loading your ad
});

Prototype JS

document.loaded
0
source

Source: https://habr.com/ru/post/1734900/


All Articles