Webchat: JavaScript API, embed attributes and Google Analytics events

Omnifox.open, close, toggle, isOpen, identify and logout; data-* embed attributes; events for GA4 and Tag Manager.

Nov 02, 2026

Watch this step in the video · JavaScript API and attributes

Methods (once the widget has loaded, or with the command queue):

  • Omnifox.open(), Omnifox.close(), Omnifox.toggle(), Omnifox.isOpen()
  • Omnifox.identify({...}) (see secure identification) and Omnifox.logout() (forgets the visitor; use it on sign-out).

Embed code attributes (they override the settings on that page only): data-color, data-position (bottom-left/bottom-right), data-name, data-greeting, data-locale (es/en/pt), data-auto-detect="false", data-proactive-greeting, data-proactive-key, data-proactive-delay, data-visitor (name/email for the radar, unverified).

Events: the widget sends omnifox_widget_loaded, omnifox_widget_opened, omnifox_conversation_started and omnifox_message_sent to your site's dataLayer/gtag, with the widget key. Use them in GA4 or Google Tag Manager to measure conversions that start in the chat.

Was this helpful?

Related articles

Message us on WhatsApp