siliconrelay.com

Installing the ad tag

Where to paste your zone snippet, the Standard vs SPA choice, and why a slot renders blank.


Each zone you create has its own snippet. Paste a zone's snippet into your page HTML wherever you want that ad to appear. The tag loads asynchronously and injects the winning banner in place, with no layout shift and no blocking of your page.

Standard vs SPA

Every zone gives you two snippets, on tabs:

  • Standard: the declarative one-liner. Use this on ordinary pages that do a full load each time you navigate. Drop it where the ad should render and you're done.
  • SPA / dynamic pages: the command-queue version, for sites that navigate without a full page reload (single-page apps, client-side routers). After the initial load, call refresh() once per view to render ads for the new page, and destroy() to tear down the ads from the previous view before you swap content in. This keeps counts honest when the URL changes but the browser never reloads.

If you're not sure which you have: if clicking around your site triggers a full browser reload each time, use Standard. If it doesn't, use the SPA snippet.

Multiple zones on one page

You can place as many zones on a page as you like, one snippet per zone. Each renders independently and is billed independently. Don't reuse one zone's snippet in two spots. create a second zone instead, so your reporting can tell them apart.

Why a slot renders blank

A zone only fills when a size-matched, active campaign is available for that request. If a slot renders blank, the usual reasons are:

  • No active campaign currently matches any size the zone accepts.
  • Targeting on the available campaigns excluded this visitor (geo, device, or schedule).

If a zone goes blank often, widen it: a zone accepts a set of sizes, and every size you add is another pool of campaigns that can fill it. Tick them under Accepted ad sizes on the zone's settings. No snippet change is needed, because the slot takes its size from the ad that wins, not from anything in your page.

The trade-off is layout: a zone with more than one accepted size changes height between fills. Leave room for the tallest size you accept, or keep the set to one size if you need a fixed height.

Blank is a normal fill outcome, not an error. Your fill rate on the reporting page shows how often requests found an ad.

Managing your zones

A few controls live on each zone's code page and in the Zones list:

  • Site URL (optional): the page a zone runs on. Set it and we'll periodically check that the page is reachable and email you if it looks down. See Site-health alerts. Serving is never affected either way.
  • Blocked advertiser domains: keep specific advertisers off a zone. See Blocking advertisers from a zone.
  • Archive & restore: archiving a zone stops its snippet from filling right away (you'll be asked to confirm). It isn't gone for good: archived zones sit in an Archived zones section you can restore from with one click, and the snippet keeps the same code, so a restored zone starts filling again on the page it's already installed on, no re-paste needed.