Reach users after they leave. In production, opt-in prompts and campaigns are
configured and sent from the Ocamba dashboard; this page walks the same flow through the
Hood() API so you can see each step. It runs for real against this origin: grant
permission and the notification in step 3 is a genuine browser notification through the service
worker.
Request permission — in context, not on load
One call opens the browser prompt and, once granted, creates the push subscription against
your VAPID key. Asking on a user gesture (like this button) converts far better than an
unprompted popup — and some browsers require it.
// production: push is enabled from the Ocamba dashboard (auto-config) —
// your code only picks the moment to ask:
Hood('pushRequestPermission');
// fully programmatic alternative:
Hood('init', 'YOUR-TAG', { push_config: { key: 'YOUR-VAPID-PUBLIC-KEY' } });
Inspect the subscription
The status panel above shows the live browser state: secure context, permission,
service-worker registration and the push subscription itself. The SDK reports the same state
through Hood('pushStatus', cb) — this page registered one on load, so status
updates also appear in the call log.
Hood('pushStatus', function (status) {
console.log('push status:', status);
});
Show a notification
Delivered through the registered service worker — the same path a real campaign push takes.
With permission granted, this button produces an actual system notification:
Hood('pushMessage', {
title: 'Weekend sale is live',
options: {
body: '40% off everything until Sunday.',
icon: '/images/logo.svg'
}
});
Analytics? Already done.
There is no step four — prompt impressions, grants, dismissals and the subscription itself
are tracked automatically by the SDK and land in your Ocamba analytics the moment they
happen. Nothing to instrument.
The same reach on iOS and Android
Web push is one third of the story — the Ocamba demo apps deliver the same
campaigns natively over APNs and FCM, tied to the same user identity.
Get the demo apps on the overview page.