Birch Reserve · For hub builders

Hub drop-in kit

One script and one tag per slot. Our ads show only in the slots we agreed with you. When there's no ad, the tag stays empty and takes no space. No cookies, no extra tracking.

Copy · paste · check with ?br_ads=test

Not live yet. A hub only shows ads after Randy or Jon approves that hub in the Birch ad system. Until then every slot on the hub stays empty, even if the tag is pasted.

1. Paste this

<!-- 1. Once per page (or once in your app shell) -->
<script async src="https://birchreserve.net/ads/embed.js"></script>

<!-- 2. One tag per agreed slot. Empty = takes no space. -->
<div data-br-slot="HUB.dashboard" data-br-format="card,hero_phone"></div>

Replace HUB with your hub id (we send it to you) and keep the placement name after the dot.

React / single-page apps
// React / Next / Vite: render the tag; the embed finds it (also after route changes).
export function BirchSlot({ slot, format }: { slot: string; format?: string }) {
  return <div data-br-slot={slot} data-br-format={format} />;
}

The embed watches the page for new slot tags. To force a re-scan: window.__brAds && window.__brAds.scan().

2. Slot map

Slot id = <hub id>.<placement>. Use only the slots in your agreement.

Slot id ends inWhere it goesdata-br-formatContainer
.landing
Hub landing page (pre-login)
Hub home, under the hero or first content block. Never above the hero.hero_wide,hero_phone,landscape,leaderboard,video_landscapeFull content width, up to 1200 px
.dashboard
Member dashboard (post-login)
Member home after sign-in, between the first and second cards.hero_phone,landscape,vertical,card,video_verticalCard column, 320–728 px
.products
Product pages
Product list or product page, after the first row or under the buy box.card,mrec,video_landscape300–728 px
.services
Services & booking pages
Service and booking pages, under the service details, above the footer.card,mrec,video_landscape300–728 px
.post_purchase
Post-purchase
Order or booking confirmation, under the confirmation message.splash,vertical,video_vertical320–728 px

Your hub id comes with your agreement (lowercase, e.g. yourhub). Each hub only uses its own id.

Format ids and sizes: creative specs. Leave data-br-format off to accept every format made for that placement.

3. Options

AttributeNeeded?What it does
data-br-slotYesThe slot id from the map.
data-br-formatNoComma list of format ids this spot can show (e.g. card,mrec). Anything else never shows here.
data-br-reserveNoHolds the first format's shape while the ad loads (for slots on the first screen). Collapses if there's no ad.
data-br-text="off"NoHides the optional headline and button row under the ad.
data-br-test="1"NoTest mode for this one slot.
Children inside the tagNoYour own "house" card. It stays when there's no paid ad and hides when one shows.

4. How it behaves

5. Security headers and domains

If your site sends a Content-Security-Policy, add:

script-src  https://birchreserve.net
connect-src https://birchreserve.net
img-src     https://birchreserve.net
media-src   https://birchreserve.net

6. Check it works

  1. 1Open the page with ?br_ads=test on the address (e.g. /home?br_ads=test). Test mode shows only test ads, labelled "Sponsored · TEST". Real visitors never see them.
  2. 2In the browser console: [...document.querySelectorAll('[data-br-slot]')].map(e => e.dataset.brSlot + ' ' + e.dataset.brState). You want paid (ad showing) or house (no ad booked, tag empty).
  3. 3Network tab: one call to /v1/ads/serve?slot=… per slot, answered with JSON.
  4. 4Or from a terminal:
curl -s "https://birchreserve.net/v1/ads/serve?slot=HUB.dashboard&test=1"
# {"fill":false,"reason":"no_eligible_campaign"}  → slot id is right, nothing booked (fine)
# {"fill":false,"reason":"unknown_slot"}          → check the slot id
# {"fill":true, ...}                              → an ad will show

Please don't

Questions

Email randy@scalehealth.ca with the subject "Hub drop-in kit", your hub id and the page link. We'll check the slot from our side.