I read this, this and this, but I think my situation is different.
I don’t need to refresh Ads everytime I make an AJAX call.
I have a page call it “mypage.php”. I load Adsense advertisement into first div, when page is opened. My second div is empty.
After DOM is fully loaded, i make an AJAX post. And put the result into “lower_content” div.
Does this break Adsense TOS?
<body>
<div id="adSense_content>
<script> adsense script </script>
</div>
<div id="lower_content">
empty in start
</div>
</body>
My js file:
$(document).ready(function() {
$.ajax({
type: "POST",
url: "/getit",
success: function(data) {
$("#lower_content").html(data);
}
});
}
Note: Why I don’t load second content when page is opening? Because AJAX call replies in 6-7 seconds. When server load is high, response comes even in 10-15 seconds. To not to make visitor wait with empty page, or even bounce from the page. I show layout to visitor in start, and load content when the response of AJAX call came.
edit: Putting an ad to an empty page is againts Adsense TOS. But the page that I mentioned is empty while loading the table data. After loading the full table with AJAX the page is loaded with content. But ad is put while loading the html page.
Did some more research .. there is no easy solution to your problem.
If your site uses AJAX for a majority of the content then you can look at implementing the Google Ajax-Crawling (aka Hash-Bang) specs. This will ensure that that the Google bot and Adsense bot crawl your AJAX content. This will help with both relevant ads and search results.
https://developers.google.com/webmasters/ajax-crawling/docs/specification
Or you have to wait till the Adsense for Ajax program start again. https://developers.google.com/adsense-for-ajax/
Update: Changed answer after more research.