docs
/
AI skills

Site notice: banner, popup, age gate or cookie consent

An announcement bar, a promo popup, a toast, an age gate or the cookie-consent bar on the website, scheduled, shown until the visitor closes it, and switched on only after a yes. What each setting really does on the site, and the ones that do nothing there.

A site notice is a message the website shows on top of its pages: a banner, popup, modal or toast for announcements and promotions, a full-screen age gate, or the cookie-consent bar. Notices are made in Studio under DAM › Site notices (/app/site-notice). A notice can also be aimed at the people running the business, inside the admin console.

The settings mean different things on the website and in the console. The website decides almost everything in the visitor's browser. This page says what each setting really does there.

Ask first

  • What kind? An announcement or promotion (banner, popup, modal, toast), an age gate, or the cookie-consent bar. The last two are special (step 3).
  • The words, and any buttons. For each button: does it go to a page, close the notice, or run page code?
  • When? Should it go live now, from a start time, and until an end time?
  • Who? Should it show to website visitors, to the team in the admin console, or both? Narrowing it to signed-in roles works only in the console.
  • How often? Should it keep showing until the visitor closes it, once per browser session, or on every page?
  • Which site, if the business has more than one? Studio's form can't choose one; see step 1.

Steps

1. Site notices: the notice, as a draft

In Studio, open DAM › Site notices › New Notice. The form has five tabs (websitemint components/content/site-notice/site-notice-form.tsx). The AI uses repo_create on site_notice with the fields below, and keeps status: "draft" until step 4. Raw HTTP is PUT /repository/create with "isNew": true.

Every field (schema: dbsdk models/site-notice.ts; website behaviour: base-app components/site-notice/*):

TabFieldValues (default)On the website
ContenttitletextShown on a modal, the age gate and the consent bar only. Banner, popup and toast don't show it.
Contentcategoryverification, cookie-consent, announcement, alert, update, promotion, info, reminder (info)verification and cookie-consent are special (step 3). The others only set the colour and icon: alert red, announcement blue, update purple, promotion green, reminder yellow, info grey.
ContentbodyHtmlrich textThe message. It is used if set, otherwise bodyText. Both are written as HTML, except on the age gate and consent bar, where bodyText is plain text.
ContentbodyTexttextas above
Contentprioritynumber ≥ 1 (1)Ignored on the website. Notices come in the order last changed, newest first. Only the console feed sorts by it.
Content (age gate only)rejectRedirectUrlURLWhere No, Exit sends the visitor (https://www.google.com if empty).
Display & TriggersdisplayTypepopup, banner, toast, modal, inline (popup)See the table below.
Display & TriggerstriggeronPageLoad, onAction, onDelay, manual (onPageLoad)See the table below.
Display & TriggerstriggerSelectorCSS selectorfor onAction
Display & TriggersdelayMsms (0). Studio asks in seconds.onPageLoad waits this long. onDelay waits this long, or 3 s when it is 0.
Display & TriggersshowFrequencyoncePerUser, oncePerSession, always (oncePerUser)See step 2.
(not in the form)rememberViewboolean (true)Studio dropped this field, but the website still reads it: false brings the notice back on every page even after it is closed.
SchedulingstartTime / endTimedate-time, or emptyLive only inside this window. Empty means open-ended.
(buttons)statusdraft, scheduled, active, paused, expired (draft)Only active, and scheduled once its start time has come, are shown. The engine turns scheduled into active at start and anything past its end into expired (appengine notice.service.ts 418–433).
Audienceaudience.surfacesite, admin, both (empty means site)Enforced. admin never reaches the website, and site never reaches the console (appengine notice.query.ts 54–65).
Audienceaudience.rolesowner, admin, poweruser, user, customerNot enforced on the website. Tested: a notice for admin showed to a signed-out visitor. In the console only, the viewer must hold a role that contains the word (notice.service.ts 158–177).
(not in the form)audience.tags, audience.conditionNothing reads them, on the website or in the console.
(not in the form)sitelist of site namesEmpty or missing means every site of the business. Studio's form never sets it, so a notice made there shows on all sites. Set it with repo_create / repo_update to limit it (notice.query.ts 35–36).
Actionsactions[]{ label, actionType: link / dismiss / callback, url, callbackKey }A button each. See step 2.
(read only)metricsviews, clicks, dismissals, accepts, rejectsCounted only for notices shown in the console (step 5).

How each display type shows on the website (tested on a local site unless noted):

displayTypeWhat the visitor sees
bannerA full-width bar with the message, the buttons and a close ✕. On the test site it sat under the header and above the page, and scrolled with the page. Several banners rotate every 5 s. With showFrequency: always it has no ✕.
popupA centred card over a dimmed page, with a ✕, the message and full-width buttons. No title.
modalA dialog over a dimmed page with the title, a ✕, the message and the buttons.
toastA small card at the bottom right, with an icon, the message, the buttons and a ✕. No title.
inlineNever shown. The website has no place to put it (base-app NoticeViewer.tsx 251–252).

How each trigger works on the website (useNotices.ts 142–212):

triggerWhat happens
onPageLoadShown once the page has loaded, after delayMs if set.
onDelayShown after delayMs, or after 3 s when that is 0 (tested).
onActionBroken. If the selector's element is on the page, the notice shows at once on load, not on the click. If it isn't there yet, the notice never shows. Tested: a toast for #promo-btn appeared before anything was clicked.
manualNever shown. Nothing on the website can open it.

Hands on: the notice's id (sk). Check: repo_find_one on site_notice shows the fields, status: "draft", and site as intended. In Studio, the notice is in the Site notices list as Draft.

2. Site notices: buttons and how often it comes back

Buttons (NoticeViewer.tsx 34–79). Each button also hides the notice, the same as closing it:

actionTypeOn click
linkA url starting with http opens in a new tab. A path on the site (/store) opens in the same tab without a full reload (router.push), so the next page's own analytics IDs and cookies don't load until a full page load.
dismissCloses it.
callbackFires a noticeAction event on window with { noticeId, callbackKey, notice }, then closes it. Tested. Handle it in the page's or root's JavaScript: window.addEventListener('noticeAction', function (e) { if (e.detail.callbackKey === 'open-signup') { … } }).

How often on the website (useNotices.ts 32–74). This is kept in the visitor's browser, and it counts closing, not showing:

showFrequencyOn the website
oncePerUserShows on every page load until the visitor closes it or presses a button. After that, never again in that browser (localStorage).
oncePerSessionThe same, until closed in this browser session (sessionStorage). Tested: it came back on the next page until ✕ was pressed.
alwaysShows on every page load. Closing hides it only until the next page. A banner set to this has no ✕.

The console works differently. There, "once" means once shown, and it is remembered on the server for that person (notice.service.ts 279–291). Clearing the browser, a private window or another device shows a website notice again.

Hands on: nothing new. Check: the Actions tab lists the buttons in order, with a URL or a callback key on each.

These two ignore displayType, trigger, showFrequency and actions. The website draws them its own way, with fixed buttons (NoticeViewer.tsx 108–187). Studio's hint to "use the Actions tab to add Accept/Reject buttons" is wrong for both.

Age gate (verification)Cookie consent (cookie-consent)
Looks likea full-screen dark overlay with a card: the title (default "Age Verification Required"), the message, No, Exit and Yes, I'm of Agea dark bar fixed to the bottom: the title (default "Cookie Consent"), the message, Reject and Accept All
Yes / AcceptlocalStorage.site_age_verified = 'true', never asked again in that browserlocalStorage.site_cookie_consent = 'true', fires site-cookie-consent, and the site's cookies marked Only after cookie consent are set at once
No / Rejectgoes to rejectRedirectUrl (tested), and is asked again next visitsite_cookie_consent = 'minimal'; the bar is gone, and consent-only cookies stay unset
Orderfirstwaits until the age gate is answered (tested)
Several of themonly the first one is usedonly the first one is used

What consent covers, and what it doesn't:

  • It releases the cookies set in Site Config with Only after cookie consent (Site cookies from the address, with consent).
  • It does not hold back Google Analytics or the Meta Pixel. Those fire for every visitor on load (tested: _ga and a Pixel PageView with the bar still showing). To gate them, use Consent Mode for GA and load the Pixel from root's code after site-cookie-consent. Both are in Google Analytics, the Facebook Pixel and site verification step 5.
  • The website doesn't keep a record of who consented. It lives only in each browser.
  • For a "change cookie settings" link, see the site-cookies page.

The age gate is a curtain, not a lock. It is drawn in the browser after the page loads. The page itself is in the HTML: search engines, link previews and anyone with scripts off see everything. Don't rely on it to keep content from minors where the law needs real age checks.

Hands on: nothing new. Check: a site has at most one active notice of each of these two categories.

4. Site notices: switch it on

In the notice's form, press one of the buttons at the bottom:

  • Activate sets status: "active".
  • Schedule appears when Active From is in the future, and sets status: "scheduled".
  • Pause sets paused.
  • Save keeps the current status.

The AI does the same with repo_update, patch: { "status": "active" }. Leave startTime/endTime to frame the window.

A live notice reaches visitors only when all of these are true (appengine notice.query.ts 15–36, 54–75, read into the site by repository.enrichment.service.ts 239–270):

  • the status is active, or scheduled with its start time past;
  • now is inside startTime to endTime;
  • site is empty, missing, or names this site;
  • audience.surface is site, both or unset.

Then, in the visitor's browser:

  • it isn't already closed, per step 2;
  • its trigger isn't manual, and its type isn't inline.

Website notices show only on the site's own pages. They are drawn by ordinary pages and Site Feature pages. They don't appear on /login, /register, /account/…, /checkout/… or /order/…. Tested: neither the banner nor the consent bar appeared on /account, which opened the login screen. A cookie-consent bar therefore can't be answered on those screens.

Stop: activating shows the notice to every visitor of the site on their next page load, and an age gate blocks the whole site. Show the person the wording, the type, the window and the site. Activate only after a yes.

Hands on: the notice's status. Check: open the site in a private window and see it. Then press ✕, reload, and see that it stays closed (unless it is always).

5. See what it did

Notice insights (Studio's Performance and Activity views, GET /notice/insights, GET /notice/:id/insights, GET /notice/activity) count only what the console records. That covers POST /notice/:id/display, /click, /accept, /reject and /dismiss, written per viewer (appengine notice.controller.ts 59–121).

The website records nothing. Its notices post views, clicks and dismissals to /api/site-notice/metrics, an address the engine doesn't have. Tested: every one returned 404 (base-app useNotices.ts 118–139). A website banner's Performance stays at zero, whatever visitors did. To count clicks, use a link button with UTM tags in its URL, or a callback button whose handler sends a GA event.

Hands on: nothing new. Check: for a console notice, its insights show views. For a website notice, check reach with GA instead.

When it's done

Tell the person:

  • what the notice says, its type and trigger, where it shows (website, console or both, and which site), its window, and how often it comes back;
  • whether it is live or still a draft;
  • for cookie consent, which cookies wait for it, and that GA and the Pixel don't unless step 5 of the analytics skill was done.

What it can't do yet

  • onAction shows on load, and manual and inline never show on the website.
  • No role, tag or condition targeting on the website. Only surface and site narrow it. Roles narrow it only in the console. audience.tags and audience.condition are read nowhere.
  • No site picker in Studio's form. Notices made there show on every site of the business.
  • priority doesn't order website notices.
  • No website metrics (404). Insights are the console's only.
  • Remembered per browser. Closing a website notice, accepting cookies and passing the age gate are all stored in localStorage/sessionStorage, not per person.
  • No page targeting. A notice shows on every page of the site, and can't be limited to one page or path. For one page's own message, build it into the page with a wm-dialog (see Build a website page).
  • No title on banners, popups and toasts. Put the headline in the message.

Don'ts

  • Don't promise "only signed-in customers see this" for a website notice. It shows to everyone.
  • Don't use onAction, manual or inline for a website notice.
  • Don't add Accept/Reject buttons in Actions to a cookie-consent or age-gate notice. They are ignored.
  • Don't make two active cookie-consent notices or two age gates.
  • Don't put a visitor's input or anything untrusted in bodyHtml. It is written into the page as HTML.
  • Don't activate an age gate or a full-screen popup on a live store without a yes.
  • Don't report a website notice's reach from its Performance tab. It is always empty.