Skip to content
GuidesChecked 19 November 2026

Track feedback widget events in your analytics

The embed script fires eight events, each with a payload you can forward to your own analytics tool.

Free for one project and 100 votes. Paid plans start with a 14 day trial, no card.

The events

ready, render, error, vote, identity, open, submit and close. You listen with VoteFirst.on and the name.

Eight events, and each one carries what you need.

Add your listeners in the same script as init and they still catch ready.

ready fires once the script has started and carries the project and the script version. render fires when a widget finishes drawing, including after a refresh, and carries the widget and the element it drew into. error fires when a widget could not load, a submission failed or a sign in was refused, and carries the widget and the error.

vote fires when a vote control is used. It carries the feature, hasVoted for whether the visitor now has a vote on it, and the whole result. identity fires when the visitor signs in or is given an anonymous identity. open, submit and close are for the popups. submit carries the feature that was filed.

Track a vote

Listen for vote, and send the request's heading and whether the visitor now has a vote on it.

Send each vote to your analytics in a few lines.

hasVoted is false when someone takes a vote back.

The event carries the feature itself, so you do not need a second request to learn what was voted on. Send the heading, or the id if your analytics tool prefers a stable key.

Withdrawals arrive through the same event with hasVoted false, so send that too if you want the net number, or skip it if you only count new votes.

A vote
VoteFirst.on('vote', function (event) {
  analytics.track(event.hasVoted ? 'roadmap vote' : 'roadmap vote removed', {
    feature: event.feature.heading
  });
});

Track a suggestion

The suggestion and report popups emit open, submit and close. submit carries the feature that was filed.

Count suggestions and see where the form is opened.

The widget field in the event tells a suggestion from a problem report.

Together they give you a small funnel: how often the form is opened, how often it is sent and how often it is closed without sending. If many people open it and few send, the form or the wording is the thing to look at.

The wording of the form is yours to change, and the guide on translating the widget lists every key.

The suggestion form
VoteFirst.on('open', function (event) { analytics.track('suggest opened', { widget: event.widget }); });
VoteFirst.on('submit', function (event) { analytics.track('suggest sent', { widget: event.widget }); });
VoteFirst.on('close', function (event) { analytics.track('suggest closed', { widget: event.widget }); });

Handle errors

Everything the script rejects with is an Error with a code, a message, a status and a field.

Branch on the error code, never on the message.

The code is the stable half. The message is written for a person and can change.

status is the HTTP status, or 0 if the request never reached the server. field names the field at fault when the code is validation_failed, and is null otherwise. An error event carries the same object, so a promise and a listener both give you the same thing to handle.

Three codes come from the script itself. not_configured means init has not run with a project and a key. network means the request never left, which is a reader who is offline or an extension blocking it. A code such as http_404 appears when a response carried a status but no body to read a code from.

Ignore a repeat vote, log the rest
VoteFirst.client.vote(1234).catch(function (error) {
  if (error.code === 'already_exists') return;
  console.error(error.status, error.code, error.message);
});

Listeners

VoteFirst.on listens to the whole page. A widget you draw returns a handle that listens to that widget alone.

Add a listener whenever you like, and take it off when you leave.

Use off with the same function to stop listening.

A global listener covers every widget on the page, which is what you want for analytics. A handle listener suits one widget, such as a vote button in a product page you want to measure on its own.

In a single page app, remove a listener when the component goes away, or each visit will add another and one vote will be counted twice.

Order and failures

A widget's own listeners run first, then the global ones, and each runs inside its own guard.

A listener that throws does not stop the others.

A thrown error is written to the console and the next listener still runs.

If you hook analytics once on VoteFirst.on, your code runs after any listener attached to that single widget. That order is fixed, so a handle listener can prepare something your global listener then reads.

A listener that throws is caught. The script writes a console line that begins with VoteFirst and names the event, and carries on with the rest. An analytics call that fails will never break a vote, and it will never stop the other listeners either.

Calling off with only the event name removes every listener for it. Calling it with the same function you passed to on removes just that one, which is the safer form in a component.

A component that cleans up
function track(event) {
  analytics.track('roadmap vote', { feature: event.feature.heading });
}

VoteFirst.on('vote', track);

function teardown() {
  VoteFirst.off('vote', track);
}

What you can measure

Votes by request

See which request people vote on from your own pages, in the tool you already use.

A suggestion funnel

Opened, sent and closed, from the three popup events.

Errors you can act on

A stable code and a status for every failure, including a reader who is offline.

Add tracking in four steps

A few lines in the page that already loads the script.

Pick the events

Start with vote and submit, which are the two worth reading.

Add the listeners

Call VoteFirst.on with each name and send what you need to your tool.

Handle an error

Log the code and the status, and ignore already_exists.

Remove them on exit

In a single page app, call off when the component goes away.

Naming the events in your analytics

Give each forwarded event a prefix such as feedback_ so that the events sort together in your reports. Map the vote, the suggestion and the error to three names, keep the payload fields you need and drop the rest.

Testing a listener

Open the page, vote on a request in a private window and look for the event in your analytics debug view. A listener with a misspelled name stays silent forever, so test each one once.

Compare the weekly counts with the totals on the board and expect a gap, since people vote in places your page never sees.

What to know before you track

  • Events exist only in the web embed script. The Swift package has its own calls.
  • The event hands your page data, and your listener decides where it goes, so check your own consent rules first.
  • A misspelled event name is accepted and never fires, so test each listener once.
  • A vote count in your analytics is not the board's count, because people also vote outside your page.

What developers ask about widget events

Which events does the script emit?

ready, render, error, vote, identity, open, submit and close.

What does the vote event carry?

The feature, hasVoted for whether the visitor now has a vote on it, and the whole result.

Does a listener added after init still work?

Yes, if you add it in the same script as init. Ready fires on the next turn, so a listener added later misses it.

How is a withdrawn vote told apart?

The vote event carries hasVoted as false.

What does an error status of 0 mean?

The request never reached the server.

Can a listener be limited to one widget?

Yes. A widget returns a handle with its own on and off.

How is a suggestion told apart from a problem report?

The open, submit and close events carry a widget field, which is suggest or report.

What does it cost?

Free holds one project and 100 votes, enough to try widget analytics. Past that, it runs on Lite at $9/mo or Pro at $39/mo, after a 14 day trial with no card.

See what people vote on

Begin on Free with one project. When widget analytics outgrows it, Lite is $9/mo and Pro is $39/mo, each after a 14 day trial with no card.