The web engagement SDK your business team runs.
Hood Tag brings push notifications, in-page modals, a trigger-based tag manager,
analytics and identity to any site through a single async script. Day to day, campaigns are
built in the Ocamba dashboard and delivered as auto-config — from business idea to live
in minutes, versioned, with one-click rollback and no devops in the loop. These demo pages drive
the very same engine through the Hood() API so you can read exactly what runs —
watch the call log on each page.
What you can build with it
Modals & in-page messages
Announcements, newsletter capture, paywalls, NPS surveys — themed, animated, A/B tested, rendered in an isolated shadow root with an automatic iframe fallback.
Open the modal gallery ›Web push notifications
The full lifecycle in three calls: request permission, inspect the subscription, show a notification — plus the service-worker plumbing already done for you.
Run the push flow ›Tag manager
Click, scroll, timer, visibility, form-submit and custom-event triggers firing actions on your page — rules your team launches from the dashboard, no site release required.
Open the trigger playground ›Events, identity & consent
Identify users, track custom and e-commerce events, set properties and tags — every call consent-gated with granular GDPR categories.
See the events panel ›The Hood() API surface
Calls queue before the SDK loads and execute in order once it boots — safe to call anywhere, anytime. Canonical names below; deprecated aliases in parentheses.
| Call | What it does | Example |
|---|---|---|
| Setup | ||
init | Boot with a tag and an inline config — the programmatic alternative to server-side auto-config. | Hood('init', 'TAG', { tag_config, modals_config }) |
config | Set a single config key before init (endpoints are forced to https). | Hood('config', 'disable-autoconf', 1) |
consent | Granular GDPR consent — boolean for all categories, or per category. | Hood('consent', { analytics: true, advertising: false }) |
| Identity & audience | ||
identity (identify, setUserId) | Attach your user id to everything that follows. | Hood('identity', 'user-123') |
setUserProperties | Attach profile attributes (plan, phone, email…). | Hood('setUserProperties', { plan: 'pro' }) |
addTags | Segment the user with audience tags. | Hood('addTags', ['sports', 'newsletter']) |
setUserLanguage | Preferred language for messages. | Hood('setUserLanguage', 'en') |
setUsersList | Assign the user to a managed list. | Hood('setUsersList', 'beta') |
linkAdPlatformId (setPartnerId) | Link an external ad-platform id. | Hood('linkAdPlatformId', 'gaid-…') |
setCampaignParams (utm) | Campaign attribution (UTM) override. | Hood('setCampaignParams', { source: 'newsletter' }) |
| Events | ||
trackEvent | Custom event — also fires matching tag/modal event triggers. | Hood('trackEvent', 'signup_completed', { plan: 'pro' }) |
trackSubscription | Subscription lifecycle signal for your own channels (push opt-ins are tracked automatically). | Hood('trackSubscription', 'newsletter', { src: 'footer' }) |
trackProductView · trackAddToCart · trackRemoveFromCart · trackCheckoutStarted · trackOrderCompleted | E-commerce funnel events. | Hood('trackAddToCart', { sku: 'X1', price: 49 }) |
on | Subscribe to SDK lifecycle callbacks. | Hood('on', 'autoconfReady', cb) |
| Push notifications | ||
pushRequestPermission (requestPushPermission) | Ask for notification permission and create the subscription. | Hood('pushRequestPermission') |
pushMessage (showPushMessage) | Show a notification through the service worker. | Hood('pushMessage', { title: 'Hi', options: { body: '…' } }) |
pushStatus (getPushStatus) | Read the current permission/subscription state. | Hood('pushStatus', s => console.log(s)) |
Auto-config first — code when you want it
The recommended path is auto-config. Your business team builds push prompts, modals, tag-manager rules and analytics events in the Ocamba dashboard; the SDK fetches that configuration on load. The pipeline from idea to execution is minutes, not sprints: every change is versioned, previewable and rolls back with one click — engineering never ships a release for a campaign.
The same structure is also accepted in code — that's how these demo pages run, so every behavior on them is readable in view-source. Developers use it for code-driven signals (identity, events) or full inline setups:
<!-- production: one line, campaigns arrive via auto-config.
data-tag is REQUIRED — it identifies your Ocamba property -->
<script async src="https://sdk.ocmcore.comhttps://dev-sdk.ocmcore.com/sdk/ht-dev.js" data-tag="YOUR-TAG"></script>
<!-- developer option: disable the auto-config fetch and supply the same
structure yourself. data-tag stays REQUIRED, and with
data-disable-autoconf you MUST call Hood('init', tag, cfg) -->
<script>
window.HoodEngage = [];
function Hood() { HoodEngage.push(arguments); }
Hood('init', 'YOUR-TAG', {
tag_config: { tags: [ /* triggers → actions */ ] },
modals_config: { modals: [ /* in-page messages */ ] }
});
</script>
<script async src="https://sdk.ocmcore.comhttps://dev-sdk.ocmcore.com/sdk/ht-dev.js"
data-disable-autoconf="1"
data-tag="YOUR-TAG"></script>Two rules to remember: data-tag is
mandatory on the script tag in both modes — nothing runs without it; and
data-disable-autoconf="1" obliges you to boot with
Hood('init', tag, cfg), otherwise the SDK has no configuration at all. Mix
freely: ship the baseline from the dashboard and add code-level signals where needed — the API
queue works either way.