In this section

Resources / Developers / Embed

Identify visitors

Tell the Hubbo embed who is logged in so Targeting can show widgets only to identified or anonymous visitors.

Hubbo does not run your auth. After a visitor signs in on your site, call window.hubbo.identify() with your own user id. That state is stored locally in the browser and used by shared Targeting (Visitor auth: Anyone / Logged in / Logged out). Call reset() on logout.

Stub, not verified identity

Hubbo does not verify the id with your backend. Anyone who can run JavaScript in the page can set or clear it. Use it for UX targeting (logged-in banners, anonymous NPS), not for access control of private data.

Embed targeting, shareable pages

Visitor auth gates embed delivery only. Public URLs such as /page/{key}/{id} are shareable: if someone received a post in the widget, they can send that link to others. Do not treat Targeting as a lock on the public page.

API

// After your own login succeeds
window.hubbo?.identify({
  id: user.id,           // required (string or number)
  email: user.email,     // optional
  traits: { plan: 'pro' } // optional, local only
});

// On logout
window.hubbo?.reset();

// Read current visitor (or null)
const visitor = window.hubbo?.getVisitor();
  • identify with an empty id clears identity (same as reset).
  • Widgets re-evaluate targeting within about a second after identify/reset.
  • Identity is per browser (local storage). It is not sent as a server-side session.
  • For visitor-facing translations, prefer window.hubbo.setLang() — see Set visitor language. Optional traits.locale / traits.language are used only when setLang is unset (after the browser language).

Visitor auth targeting

In the admin app, open Targeting on a notification, NPS or survey (or a saved audience) and set Visitor auth to Anyone, Logged in or Logged out.

Seen notifications targeting

The same Targeting form can require or exclude selected notification ids based on seen state. Seen means the visitor opened the notification widget (bell list) while those notifications were listed — Hubbo stamps their ids in local browser storage. It is not a click on a toast or top bar, and it is not Messages. Full guide: Seen notifications targeting.

  • Must have seen: every selected id must be stamped.
  • Must not have seen: hide if any selected id is stamped.
  • Both empty: rule ignored.

Install the script first: Quick start. Targeting fields are also covered in Saved audiences, NPS settings and targeting and Survey targeting and publishing.