Creative selection for multiple ad slots

GPT stores a record of each ad currently rendered on the page. This is known as a client-side token. This token automatically enables you to correlate requests from all ad slots on a page for an indefinitely long time period. This behavior can improve monetization on pages with dynamic content where requests may be separated by long intervals, such as infinite scroll pages, pages with lazy loading, Single-Page Applications (SPA), and Progressive Web Applications (PWA).

Make creative selection decisions

Client-side tokens are used to make creative selection decisions that account for the creatives that will serve to other ad slots on the page, including the following cases:

  • Selecting multiple creatives from one set for roadblocking
  • Excluding individual creatives based on competitive exclusions
  • Preventing duplicate ads from serving to one page

Best practices

This feature is enabled for all publishers. Most publishers won't need to make any changes to benefit from this token, but we recommend some best practices for API calls and structuring your page.

Send SRA requests with all ad slots

In order to receive the expected ad serving behavior with the best possible performance, use Single request architecture (SRA) to send a request containing all ad slots you want decisioned together.

If generating SRA requests is not possible, you can fully serialize your requests to ensure the expected behavior. Each request must wait on the SlotResponseReceived event from the previous request. However, this is sub-optimal for latency and serialization should only be used if absolutely necessary.

Use destroySlots() to remove ad slots

When removing an ad slot from a page, always use the destroySlots() API call to entirely destroy the slot and remove all related objects and references from the page so that the slot no longer impacts creative selection decisions for the ad server.

The client-side token resets when destroySlots() is used to remove existing slots from the page. The token also resets when using the page navigation.

Token expiration

If you previously relied on the client-side token expiring after 30 seconds (for example, making a set of requests using SRA, then making another set of requests more than 30 seconds later, assuming roadblocking would no longer apply), consider restructuring your page or ad serving configuration.

Was this helpful?
How can we improve it?