Click trigger_fire: 'each' vs 'once'
Good for: CTA instrumentation, exit prompts. Same button, two tags — one refires on every click (see the counter), one retires after the first.
Triggers (when) fire actions (what) — the same engine that powers
modals. In production your team builds these rules in the Ocamba
dashboard and they reach the page as auto-config: launched, versioned and rolled back without a
single site release. For this demo the whole container is declared inline in one
Hood('init', …, { tag_config }) block, so you can read every rule in view-source —
interact below and watch each status strip flip the moment its trigger fires.
trigger_fire: 'each' vs 'once'Good for: CTA instrumentation, exit prompts. Same button, two tags — one refires on every click (see the counter), one retires after the first.
Good for: engaged-visitor offers ("still reading after 6s"). Started on page load:
Good for: firing tags from your own product logic — Hood('trackEvent', 'demo:custom') is matched by name, no DOM events involved.
Good for: mutually exclusive offers — tags in the same group run once per page view: whichever fires first wins.
Good for: lead capture and signup tracking without touching the form's own code.
Good for: GDPR-safe marketing tags — the userConsent trigger holds a tag until consent arrives. This page deliberately boots without consent; grant it here:
Good for: engagement-gated content and "reader" offers. Scroll through the runway below:
Good for: "saw the pricing table" signals — fires when a specific element enters the viewport:
The measurement half of the API — open your browser's network tab and watch each call become an analytics beacon. All of it consent-gated by the categories above.
Hood('init', 'YOUR-TAG', {
tag_config: {
tags: [{
id: 'engaged-reader',
triggers: [
{ type: 'scroll', config: { vertical: 50, v_unit: '%' } },
{ type: 'timer', config: { time: 6000 } },
{ type: 'click', config: { i: '#cta' } },
{ type: 'visibility', config: { s: '#pricing' } },
{ type: 'formSubmit', config: { s: '#signup' } },
{ type: 'event', config: { name: 'my-app:milestone' } }
],
// triggers_all: true, // require ALL triggers, not any
trigger_fire: 'once', // or 'each'
group: 'offers', // once per group per page view
i: '#banner', // action target…
a: 'replaceContent', // …action…
c: '<b>Welcome back!</b>' // …content
}]
}
});