Help improve the Google Publisher Tag developer experience. Share your thoughts in our survey.
Stay organized with collections Save and categorize content based on your preferences.

Refresh ad slots

You can use the refresh functionality of the Google Publisher Tag (GPT) library to dynamically reload ads without having to refresh the entire contents of your page.

In order to implement this functionality, you'll need to generate a GPT tag and apply some modifications. This sample implementation features two ad slots and corresponding buttons to refresh the slots with new ads.

Sample implementation

View demo