April 9, 2012

How to refresh/get new google adsense content?

Question by Zakukashi

I have a website where new content is updated via ajax when the user scrolls down. A kind of infinite page where as long as the user is scrolling new data comes. I have an adsense skyscraper code on the side but its at the top of the page and I would like to refresh when new content is loaded through Ajax so that I can then position it more down. Is this possible? and is this legal? Here is a close example of what I need: http://imgur.com/gallery
As you can see they have an ad on the right and everytime new content is updated via scroll a new ad is shown as well as keeping the older one in place.

Answer by Starx

This is not allowed. Read the TOS of adwords.

But a way to do it would be

var googleCode = '...your google code';
document.getElementById('googlediv').innerHTML(googlecode);

But, read this answer for more information.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!