Skip to main content

Layouts Overview

Control which ad slots load on which pages of your site.


What is a layout?

A layout is a collection of ad slots that load together on specific pages.

Example:

  • Layout nameArticle Pages
  • Scope → Page Paths
    • Starts with: /article/
    • Starts with: /blog/
    • Starts with: /news/
  • Ad Slots
    • article_header
    • article_sidebar_top
    • article_sidebar_bottom
    • article_incontent_1
    • article_incontent_2

When a user visits a URL matching the layout's scope, the listed slots load.


Why use layouts?

Without layoutsWith layouts
Same ads everywhereTailored ads per page type
Can't control slot loadingPrecise control
Hard to test variationsEasy A/B testing
Complex code changesUI-based management

Layout components

ComponentDescriptionExample
NameYour identifierArticle Pages
Scope — Page PathsTyped page-path rules (Exact, Starts with, Contains, Ends with, Regex)Starts with: /article/
Scope — AudienceOptional browser / device narrowingblank = all browsers and devices
Ad SlotsWhich slots loadheader, sidebar, incontent
Targeting (tab)Optional layout-level key-values passed into GAMsection = sports

How layouts work

When a page loads, the wrapper selects every layout whose Page Paths match the URL and whose Audience includes the visitor. There's no priority and no single "winning" layout — all matching layouts contribute: their ad slots are combined, and their Targeting key-values are merged.

Two practical consequences:

  • If two layouts both match a URL, the page loads both layouts' slots. Scope your layouts so they don't overlap unintentionally — or overlap them deliberately when you want slots to stack.
  • A catch-all Regex: .* layout matches every page, so its slots load site-wide on top of any more specific layout. Only ship one if you genuinely want those slots everywhere.

Common tasks

TaskLink
View all layoutsViewing layouts →
Create a layoutCreating a layout →
Add slots to layoutAdding slots →
Configure targetingLayout targeting →

Layout examples

News/Media site

LayoutPage-path rulesSlots
HomepageExact: /header, sidebar, below_fold
ArticleStarts with: /article/, Starts with: /story/header, sidebar, incontent × 3
CategoryStarts with: /category/header, sidebar
VideoStarts with: /video/header, sidebar (fewer slots)
DefaultRegex: .*header (fallback)

E-commerce site

LayoutPage-path rulesSlots
HomepageExact: /billboard, sidebar
CategoryStarts with: /category/header, sidebar
ProductStarts with: /product/sidebar_only (minimal)
BlogStarts with: /blog/header, incontent

Best practices

Do

  • Name layouts clearly (Article Pages not Layout 1)
  • Keep scopes disjoint so each page matches the layouts you intend
  • Check every matching layout when a page shows unexpected or duplicate slots

Don't

  • Overlap scopes by accident — matches stack, they don't compete
  • Ship a Regex: .* layout unless you want its slots on every page
  • Forget to include slots in layouts
  • Leave pages unmatched (no ads will load)

Getting started