# Key-value targeting

# Key-value targeting

This example uses key-value targeting to control the ads eligible to serve to
specific ad slots. See the [key-value targeting guide](https://developers.google.com/publisher-tag/guides/key-value-targeting) to learn
more about how this sample works.

## Sample implementation

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