Analytics

FloatMessage tracks every interaction with your floating messages and chat widget so you can measure what's working. Events are sent from the embed script in batches via navigator.sendBeacon, so they reach the server even when the visitor closes the tab.

Event types

EventFired when…
impressionA floating message renders on a visitor's page (after all targeting / scheduling / dismiss checks pass).
clickA visitor clicks any element with the fm-cta class. Also fires on contact form submissions and survey responses.
dismissA visitor closes the message via the fm-close button.
chat_openA visitor opens the chat panel (clicks the chat bubble or it auto-opens).
chat_messageA visitor sends a chat message.

How events are sent

  • Events are queued in memory inside the embed script and flushed in batches of up to 25.
  • Each batch is POSTed to /api/embed/events using navigator.sendBeacon when supported, falling back to fetch(... keepalive: true).
  • Each event includes: type, messageId (if applicable), pageUrl, country, and a stable visitorId stored in localStorage.
  • Country is detected server-side from the Cloudflare CF-IPCountry header.

Per-message stats

Each message in your dashboard shows running totals for views (impressions) and clicks. These are denormalized counters maintained from the events table — they update within seconds of new traffic.

The conversion rate is implicitly clicks / views — useful for comparing template effectiveness or optimizing copy.

Triggering CTA tracking

For templates you build yourself, attach the fm-cta class to the element you want to track as a click:

<button class="fm-cta">Get the discount</button>

The embed script intercepts the click, fires a click analytics event, also emits a cta:click JS event (see the JavaScript API) and dismisses the message.

Privacy

  • FloatMessage does not set any third-party tracking cookies.
  • The fm_vid visitor ID lives in localStorage on the visitor's own browser — not a cookie, not cross-site, never shared.
  • No PII is captured automatically. The data attached to each event is: event type, message ID, page URL, country, visitor ID. That's it.
  • To collect richer visitor data (name, plan, account ID), use the FloatMessage.setCustomData() JS API after the visitor logs in.