tode

tode compared with other tools

Mixpanel in a Figma plugin, compared with tode

Mixpanel works inside a plugin once you turn persistence off and identify users yourself. When its reports are worth that setup, and when a smaller tool is the better fit.

, by Ilia

Mixpanel is the tool people on the Figma forum most often say they got working inside a plugin, and they are right that it can be done. The question is what it takes and whether the reports you get are the ones a plugin needs. Short version: if you want funnels, cohorts and a query builder, and you are prepared to own identity yourself, Mixpanel is a fine choice. If you want the plugin numbers without the project, tode is smaller on purpose.

Running Mixpanel in a plugin

The browser SDK (mixpanel-browser) stores its distinct id in a cookie, falling back to localStorage. The plugin UI has neither, so the default setup either throws or forgets who the user is on every load. The fix is to turn persistence off and set the identity yourself from the controller:

// ui.ts (the iframe)
import mixpanel from 'mixpanel-browser';

mixpanel.init('YOUR_TOKEN', {
  disable_persistence: true,
  disable_cookie: true,
  api_host: 'https://api-js.mixpanel.com',
});

// code.ts sends figma.currentUser.id to the UI once, after showUI
window.onmessage = (e) => {
  const msg = e.data.pluginMessage;
  if (msg?.type === 'identity' && msg.userId) mixpanel.identify(msg.userId);
};

mixpanel.track('fonts_replaced', { count: 12 });

And the manifest needs the host:

"networkAccess": { "allowedDomains": ["https://api-js.mixpanel.com"] }

Sessions are yours to define. Mixpanel can stitch events into sessions in its reports based on a timeout, but the "how long was the plugin open" number needs a start and end event you send, or a duration you measure and attach. There is also a community package, mixpanel-figma, that wraps some of this; I have not used it and cannot vouch for how current it is.

Side by side

Mixpaneltode
Works in the null-origin iframeYes, with persistence disabledYes, built for it
User identityYou pass the Figma user id to identifyRead from figma.currentUser at init
Session lengthYour own events or propertiesMeasured from the UI connection, no code
CountryResolved from the request IP on their sideResolved from the request IP, IP not stored
Figma editor and modeSend them as propertiesAttached to every event
Retention, stickinessYes, configurable reportsYes, fixed definitions
Funnels, flows, cohorts, A/BYesNo
Event propertiesAny JSONOne numeric metric per event
Event typesUnlimited2 on Free, 20 on Starter, unlimited above
Price modelFree tier, then by monthly eventsFree for 1 plugin, then $12 to $99 a month for all your plugins
SetupSDK plus identity and session codeinit in the controller, an adapter in the UI

Pick Mixpanel if

You run a plugin with an onboarding flow, a paywall and several steps between them, and you want to see where people drop out. Or you have a product outside Figma and want one place for both. Or you want to attach rich properties to events and slice them later in ways you have not thought of yet. Those are real strengths and a small tool will not match them.

Pick tode if

You want the plugin numbers (active users, returning, retention, which features, how long, where, which editor) and would rather not write and maintain identity and session code. You have several plugins and want them under one subscription. Or you want the data to stay narrow by design: one metric per event, no arbitrary properties, no way to accidentally send a layer name.

Whichever you choose, the decisions in how to track usage about what to name and where to call apply the same way.