Poll

A widget for collecting user votes on various topics, with real-time results.

A widget for collecting user votes on various topics.

<div
	data-component="fu-widget"
	data-content-type="poll"
	data-content-id="your-poll-id"
	data-lead-fields="fullName,email"
	data-lead-position="after"
	data-lead-sync-with-profile="true"
	data-campaign-id="campaign-1"
	data-campaign-name="Summer Campaign"
	data-signin-cta-label="Vote Now - Sign In!"
	data-signin-cta-onclick="redirectToSignIn()"
	data-layout-template="STANDARD"
	data-options-layout="row"
></div>

Configuration Attributes

AttributeDescriptionOptionsDefault
data-layout-templateVisual layout of the poll"STANDARD", "SPLIT", "OVERLAY""STANDARD"
data-options-layoutLayout style for answer options"twoByTwo", "row", "column"Config default
data-lead-sync-with-profileSync anonymous profiles to database after lead submission"true", "false"Config default
data-consentsProfile consents — see Features → ConsentsJSON array of consent objectsConfig default
data-consents-labelsCopy for the consent surfacesJSON objectBuilt-in i18n
data-poll-aggregate-translated-votesShow results summed across every translation of the poll — see Votes Across Translations"true", "false"false

Votes Across Translations

A poll can be translated into other languages, each translation a poll of its own linked through translatedTo / translatedFrom. By default each one shows only its own votes. With data-poll-aggregate-translated-votes="true" the results show the votes of every linked translation added together, so readers of every edition see the same split. Options are matched by position — the first option of one translation counts with the first of every other — so keep the option order the same across translations.

<div
	data-component="fu-widget"
	data-content-type="poll"
	data-content-id="your-poll-id"
	data-poll-aggregate-translated-votes="true"
></div>

Global configuration:

FuWidget.init({
	// ... other config
	poll: {
		aggregateTranslatedVotes: true, // Optional: default false
	},
});

The attribute overrides poll.aggregateTranslatedVotes for that one element. The List widget reads the global setting for the polls it plays in place.

Features

  • Single or multiple choice voting
  • Real-time results
  • Optional results summed across every translation of the poll
  • Percentage visualization
  • Total votes tracking
  • Lead collection integration
  • Customizable sign-in CTA
  • Prize support
📘

Related (see the Features page): Lead Collection · Sign-in & Additional CTA · Callbacks · Rules Display · Options Layout · Authentication Requirements.


Did this page help you?