How to refresh the ad without reloading the Page?

Most of the publisher want auto refresh on their ad slot without reloading page.

Google has introduce many sample tags which will confuse the publishers or newbies. They need to edit multiple things on their site header.

But I would recommend to use simple refresh function at the body tag. That is “setInterval” function. See below.

setInterval(function(){googletag.pubads().refresh([gptadslots[0]]);}, 3000);

Explanation of above function:

gptadslots[0] – Adslot number
3000 – Time interval to refresh (3secs)

See the working example below:

Thank You!!!