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 in | Where it goes | data-br-format | Container |
|---|---|---|---|
.landingHub landing page (pre-login) | Hub home, under the hero or first content block. Never above the hero. | hero_wide,hero_phone,landscape,leaderboard,video_landscape | Full content width, up to 1200 px |
.dashboardMember dashboard (post-login) | Member home after sign-in, between the first and second cards. | hero_phone,landscape,vertical,card,video_vertical | Card column, 320–728 px |
.productsProduct pages | Product list or product page, after the first row or under the buy box. | card,mrec,video_landscape | 300–728 px |
.servicesServices & booking pages | Service and booking pages, under the service details, above the footer. | card,mrec,video_landscape | 300–728 px |
.post_purchasePost-purchase | Order or booking confirmation, under the confirmation message. | splash,vertical,video_vertical | 320–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
| Attribute | Needed? | What it does |
|---|---|---|
data-br-slot | Yes | The slot id from the map. |
data-br-format | No | Comma list of format ids this spot can show (e.g. card,mrec). Anything else never shows here. |
data-br-reserve | No | Holds 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" | No | Hides the optional headline and button row under the ad. |
data-br-test="1" | No | Test mode for this one slot. |
| Children inside the tag | No | Your own "house" card. It stays when there's no paid ad and hides when one shows. |
4. How it behaves
- Empty takes no space. No ad = an empty tag (0 px). Don't give the tag a height, padding or border.
- No layout jump. Every ad carries its real width and height. Put slots below the first screen; the ad loads before people scroll to it. On the first screen, add
data-br-reserveor a house card. - Fits the column. The ad fills the tag's width, never wider than its file. Rounded 12 px corners and a small "Sponsored" label are added for you.
- Only our endpoints.
/v1/ads/serve(pick an ad),/v1/ads/v(viewable: 50% on screen for 1 s, 2 s for video),/v1/ads/c(click). Ad files come from/v1/ads/crand/v1/ads/crv. - Privacy. No cookies. Do Not Track and Global Privacy Control are honoured. No names, emails or IP addresses are collected by the embed.
- Motion. Videos play muted and only autoplay when the visitor allows motion.
- Won't break your page. If our server is slow or down, the tag stays empty (or keeps your house card).
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
- No iframes, no third-party ad networks, no
eval. One script frombirchreserve.net. - Clicks open the brand's page in a new tab with
rel="sponsored noopener". - Inside a sandboxed iframe? Allow
allow-scripts allow-popups allow-same-origin, or place the tag outside it.
6. Check it works
- 1Open the page with
?br_ads=teston the address (e.g./home?br_ads=test). Test mode shows only test ads, labelled "Sponsored · TEST". Real visitors never see them. - 2In the browser console:
[...document.querySelectorAll('[data-br-slot]')].map(e => e.dataset.brSlot + ' ' + e.dataset.brState). You wantpaid(ad showing) orhouse(no ad booked, tag empty). - 3Network tab: one call to
/v1/ads/serve?slot=…per slot, answered with JSON. - 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 showPlease don't
- Crop, stretch or overlay the ad, or wrap it in your own link.
- Hide or restyle the "Sponsored" label.
- Copy ad files to your own server (counts and approvals depend on ours).
- Add slots that aren't in your agreement.
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.