Skip to content

A slot asks for every format at every viewport width #1287

Open

Description

@jwrosewell

The problem

A slot's formats are the sizes a page asks for, and the page asks for all of them at every width. A page that shows a billboard on a wide screen and a small banner on a phone has one slot and several formats, so a bidder is offered a billboard the page cannot show, and the ad tag defines the slot with every size at every width.

The change

A format may name min_viewport_width and max_viewport_width, in CSS pixels, the viewport widths at which the page asks for it. Either bound may be left out, and a minimum above a maximum is refused when the settings load.

[[creative_opportunities.slot]]
id = "billboard"
page_patterns = ["/**"]
formats = [
  { width = 970, height = 250, min_viewport_width = 1040 },
  { width = 320, height = 50, max_viewport_width = 599 },
]

When any format of a slot names a bound, the slot's page data carries viewport_sizes, one entry for each band of widths, widest first, and the Google ad tag's head bootstrap and the bundle's slot definition apply it as a size mapping when they define the slot. A band starts at zero and at every width where the formats on offer change, and a band with no format asks for nothing. A slot whose formats name no bound asks for every format at every width, as before. The bounds apply in the browser only, and a server-side auction is still offered every format.

A binary released before these fields refuses a format carrying either of them and fails to load its settings, so the binary that reads them is promoted before any configuration uses them.

Where it is

Draft on the fork, jwrosewell#24, on top of the device signals (fork pull request 23).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions