Announcement modal
Good for: product news, feature launches, service notices. Light theme, fade-in, closes on backdrop click or Esc.
In production, modals are designed and published from the Ocamba dashboard —
your team iterates on copy, targeting and A/B splits without touching the site. On this demo page
the same configs are declared inline in one Hood('init', …, { modals_config })
block, and each opens when its named event trigger fires — the buttons simply call
Hood('trackEvent', 'demo:…'). Templates render in an isolated shadow root (with
automatic iframe fallback), so your page styles and the modal never collide. Watch the call log
as you click.
Good for: product news, feature launches, service notices. Light theme, fade-in, closes on backdrop click or Esc.
Good for: drawing the eye without being jarring — fade-in, slide-up, slide-down, zoom-in. This one slides up.
Good for: matching dark-mode sites or high-contrast campaigns. theme: 'dark' with zoom-in.
Good for: toasts and confirmations that shouldn't demand a click — close_auto: 4000 dismisses it after 4 seconds.
Good for: testing copy or design — the SDK picks variant A or B by weight on each open (persistable per user). Open a few times to see both.
Good for: capping pressure — modals in the same group show at most once per page view. Open the first, then try the second: it stays silent.
Good for: flows that need an explicit choice — backdrop clicks are ignored (close_click: false), only the CTA (or Esc) closes it.
Good for: hostile CSS environments — renderMode: 'iframe' forces the iframe path the SDK otherwise uses as an automatic fallback.
Good for: measuring satisfaction in-page — a full multi-step Net Promoter Score survey with form capture, all inside one modal template.
Hood('init', 'YOUR-TAG', {
modals_config: {
modals: [{
id: 'welcome',
template: 'basic-modal-template', // fetched from your modal_url
trigger_fire: 'each', // reopenable ('once' = per page view)
triggers: [{ type: 'event', config: { name: 'show-welcome' } }],
options: {
theme: 'light', // light | dark
animation: 'fade-in', // fade-in | slide-up | slide-down | zoom-in
close_click: true, close_esc: true, // backdrop / Esc dismissal
close_auto: 0 // ms; 0 = never
}
}]
}
});
// anywhere later — open it:
Hood('trackEvent', 'show-welcome');Triggers aren't limited to events: the same modal can open on scroll depth, timers, exit intent, element visibility or form submits — modals and tags share one trigger engine.