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 name —
Article Pages - Scope → Page Paths
Starts with: /article/Starts with: /blog/Starts with: /news/
- Ad Slots
article_headerarticle_sidebar_toparticle_sidebar_bottomarticle_incontent_1article_incontent_2
When a user visits a URL matching the layout's scope, the listed slots load.
Why use layouts?
| Without layouts | With layouts |
|---|---|
| Same ads everywhere | Tailored ads per page type |
| Can't control slot loading | Precise control |
| Hard to test variations | Easy A/B testing |
| Complex code changes | UI-based management |
Layout components
| Component | Description | Example |
|---|---|---|
| Name | Your identifier | Article Pages |
| Scope — Page Paths | Typed page-path rules (Exact, Starts with, Contains, Ends with, Regex) | Starts with: /article/ |
| Scope — Audience | Optional browser / device narrowing | blank = all browsers and devices |
| Ad Slots | Which slots load | header, sidebar, incontent |
| Targeting (tab) | Optional layout-level key-values passed into GAM | section = 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
| Task | Link |
|---|---|
| View all layouts | Viewing layouts → |
| Create a layout | Creating a layout → |
| Add slots to layout | Adding slots → |
| Configure targeting | Layout targeting → |
Layout examples
News/Media site
| Layout | Page-path rules | Slots |
|---|---|---|
| Homepage | Exact: / | header, sidebar, below_fold |
| Article | Starts with: /article/, Starts with: /story/ | header, sidebar, incontent × 3 |
| Category | Starts with: /category/ | header, sidebar |
| Video | Starts with: /video/ | header, sidebar (fewer slots) |
| Default | Regex: .* | header (fallback) |
E-commerce site
| Layout | Page-path rules | Slots |
|---|---|---|
| Homepage | Exact: / | billboard, sidebar |
| Category | Starts with: /category/ | header, sidebar |
| Product | Starts with: /product/ | sidebar_only (minimal) |
| Blog | Starts with: /blog/ | header, incontent |
Best practices
Do
- Name layouts clearly (
Article PagesnotLayout 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)