# Ad sizes

# Ad sizes

This example demonstrates various ways of specifying which ad sizes are eligible
to serve to an ad slot using the Google Publisher Tag library. Learn more about
the available options in the [ad sizes guide](https://developers.google.com/publisher-tag/guides/ad-sizes).

> [!CAUTION]
> **Caution:** Be aware of [ad slot expansion](https://support.google.com/admanager/answer/9117822) and [contraction settings](https://support.google.com/admanager/answer/9433610), which can affect the range of sizes eligible to serve to your ad slots.

## Sample implementation

[View demo](https://googleads.github.io/google-publisher-tag-samples/ad-sizes/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/ad-sizes/js) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback:+ad-sizes/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/ad-sizes/ts) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback:+ad-sizes/ts)