# Refresh ad slots

# 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.

> [!IMPORTANT]
> **Important:** To comply with Google policy and enable your inventory to compete on Ad Exchange, you must [declare which portions of your inventory refresh](http://support.google.com/admanager/answer/6286179).

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](https://googleads.github.io/google-publisher-tag-samples/refresh/js/demo.html)

### JavaScript

## Loading...

<iframe id="builder" class="fixed-size" loading="lazy"></iframe>

## Loading...

[Improve this sample](https://github.com/googleads/google-publisher-tag-samples/tree/main/dist/refresh/js) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback:+refresh/js)

### TypeScript

## Loading...

<iframe id="builder" class="fixed-size" loading="lazy"></iframe>

## Loading...

[Improve this sample](https://github.com/googleads/google-publisher-tag-samples/tree/main/dist/refresh/ts) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback:+refresh/ts)