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
| Event | Fired when… |
|---|---|
| impression | A floating message renders on a visitor's page (after all targeting / scheduling / dismiss checks pass). |
| click | A visitor clicks any element with the fm-cta class. Also fires on contact form submissions and survey responses. |
| dismiss | A visitor closes the message via the fm-close button. |
| chat_open | A visitor opens the chat panel (clicks the chat bubble or it auto-opens). |
| chat_message | A 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/eventsusingnavigator.sendBeaconwhen supported, falling back tofetch(... keepalive: true). - Each event includes: type, messageId (if applicable), pageUrl, country, and a stable
visitorIdstored in localStorage. - Country is detected server-side from the Cloudflare
CF-IPCountryheader.
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_vidvisitor ID lives inlocalStorageon 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.