tode

tode compared with other tools

Google Analytics 4 in a Figma plugin, compared with tode

GA4 is free and familiar, and most of it is built around pages and cookies that a plugin does not have. A side-by-side on what you get from each.

, by Ilia

Google Analytics is free, familiar and already open in a tab for most people who publish a plugin. The catch is that the script does not run in a plugin, and the server-side route that does turns you into the SDK author. This page is the decision; the mechanics are in the longer note.

The two ways to use GA4 from a plugin

The gtag script in the UI iframe fails because the frame has a null origin and no cookies. You can configure it to live without storage, at which point every open is a new user, so in practice this route is off the table.

The Measurement Protocol works. From code.ts you POST events to google-analytics.com/mp/collect with your measurement id, an API secret and a client id you generate and keep in figma.clientStorage. You also send a session id and an engagement time with every event, or GA will not count the events as engaged sessions. The secret ships in your bundle, where anyone can read it.

Side by side

GA4 via Measurement Protocoltode
Runs in a pluginFrom the controller, with your own clientYes
User identityA client id you store yourselfThe Figma user id, stable across devices
SessionsSession id and engagement time sent by youMeasured automatically from the UI
Country and deviceOnly what you put in the hitCountry from the request IP, Figma editor from the API
ReportsWebsite shaped: pages, sessions, acquisitionPlugin shaped: active users, actions, metrics, sessions
RetentionStandard retention report, if identity holdsNew vs returning, week-one cohorts, stickiness
Secret in the bundleYes, the API secretAn API key that can only write events to your plugin
PriceFreeFree for one plugin, paid plans from $12 a month
DebuggingDebugView and the validation endpointDebug flag logs every call to the console

One honest point about the key: tode's API key is also visible in your bundle. The difference is scope. It can add events to one plugin and nothing else, and you can rotate it from the dashboard. GA's API secret is bound to a data stream that may be the same one your website uses.

Pick GA4 if

Free is the requirement, and you are willing to write and maintain the client, session and storage code once. Or your plugin is a companion to a website already measured in GA and you want the two in one property and one set of reports.

Pick tode if

You want retention, feature adoption and session length for a plugin without inventing an identity scheme, and you would rather look at a dashboard that uses plugin words. Or you have more than one plugin and want them side by side under one account.