Widget Attributes Reference
Complete reference for all data attributes supported by the Ekoo widget element.
Appearance attributes are optional overrides
websiteId and productId. You only need data attributes if you want to override the remote config for a specific widget instance.data-ekooReqdata-ekoo-product-idReqdata-ekoo-localeautodata-ekoo-variantdata-ekoo-review-iddata-ekoo-on-eventdata-ekoo-directionnormaldata-ekoo-scale1data-ekoo-animationpulsedata-ekoo-animation-durationcontinuousdata-ekoo-always-openfalsedata-ekoo-show-imagetruedata-ekoo-not-fully-clickablefalsedata-ekoo-autoplayfalsedata-ekoo-show-transcriptfalsedata-ekoo-show-speed-buttonfalsedata-ekoo-closed-state-main-textdata-ekoo-closed-state-secondary-textdata-ekoo-modeautodata-shadow-modeopenwindow.EKOO_FORCE_SPA = truewindow.ekooShadowMode = "open"Core Attributes
| Attribute | Required | Type | Description | Default |
|---|---|---|---|---|
data-ekoo | Required | string | Your unique Ekoo website identifier (websiteId) | — |
data-ekoo-product-id | Required | string | Product identifier matching your Ekoo catalog | — |
data-ekoo-locale | Optional | string | Ekoo locale code (e.g., "fr", "en", "cn"). See the Locales page for the full list. | Auto-detected |
data-ekoo-variant | Optional | string | Reference of the widget configuration to apply (e.g. "homepage", "product-page"). Only changes the widget styling — product, audios and reviewers still come from data-ekoo-product-id. | — |
data-ekoo-on-event | Optional | string | Name of a global window function to call on widget events (printed, played, etc.) | — |
data-ekoo-review-id | Optional | string | Target a specific audio review by ID | — |
Appearance Attributes
| Attribute | Type | Description | Default |
|---|---|---|---|
data-ekoo-direction | "normal" | "reverse" | Expansion direction of the widget bar | "normal" |
data-ekoo-scale | string (numeric) | Scale factor for the widget (e.g., "1.2") | — |
data-ekoo-animation | string | Animation type. Default is a pulsing rings effect. | "pulse" |
data-ekoo-animation-duration | string | Animation duration. Default loops indefinitely. | "continuous" |
data-ekoo-always-open | boolean string | If "true", widget stays expanded and cannot be collapsed | — |
data-ekoo-autoplay | boolean string | Auto-play audio on load | — |
data-ekoo-show-transcript | boolean string | Show transcript button | — |
data-ekoo-show-speed-button | boolean string | Show playback speed control | — |
data-ekoo-closed-state-main-text | string | CTA text when widget is collapsed | — |
data-ekoo-closed-state-secondary-text | string | Secondary text when collapsed | — |
data-ekoo-show-image | boolean string | Show product image | "true" |
data-ekoo-not-fully-clickable | boolean string | Restrict click zone to play button only | — |
SPA & Shadow DOM
| Attribute | Type | Description | Default |
|---|---|---|---|
data-ekoo-mode | "spa" | "static" | Forces SPA or static rendering mode. By default, the widget auto-detects SPA frameworks (Next.js, Nuxt, React, Vue, Angular, Sapper). Use this only if auto-detection fails. | Auto-detected |
data-shadow-mode | "open" | "closed" | Shadow DOM mode: "open" allows external CSS access and analytics tracking, "closed" provides full isolation | "open" |
Global JavaScript Configuration
These global variables affect all widgets on the page. Set them before loading the Ekoo script.
| Variable | Type | Description |
|---|---|---|
window.EKOO_FORCE_SPA | boolean | Force SPA mode for all widgets on the page |
window.ekooShadowMode | string | Set Shadow DOM mode globally ("open" or "closed") |
1<script>2 // Force SPA mode for all widgets on the page3 window.EKOO_FORCE_SPA = true;45 // Set Shadow DOM mode globally (default: "open")6 window.ekooShadowMode = "closed";7</script>89<script src="https://app.ekoo.co/widgets/widget-4.0.0-standalone.js"</script>Detailed Descriptions
data-ekoo
Your unique website identifier (websiteId), found in the Ekoo backoffice under your site settings. This value must match exactly — it is used to fetch your widget configuration, styling, and associated audio content. Placed on the widget container (div or ekoo-widget), not on the script tag.
data-ekoo-product-id
Links the widget to a specific product in your Ekoo catalog. The value must match exactly what is configured in the Ekoo backoffice. This attribute is case-sensitive — ensure it corresponds precisely to your product reference.
data-ekoo-locale
Filters audio content by language using an Ekoo locale code (e.g., "fr", "en"). If omitted, Ekoo uses browser language detection to determine the most appropriate content. When no matching locale is found, the widget falls back to displaying all available audio.
data-ekoo-variant
Picks which widget configuration to apply by its reference. Each widget configuration in the backoffice has a stable reference you choose yourself (for example homepage or product-page); set that value here to load the matching configuration.
The product, its audios and its reviewers are always resolved from data-ekoo-product-id. This attribute only changes the widget itself — its theme, CTA texts, animation, position, custom CSS. It lets you reuse the same product on different parts of your site with different widget styles, without duplicating it.
When the widget loads, Ekoo looks up the configuration in this order, scoped to your website and the current widget type:
- The configuration whose reference matches the attribute value.
- For older integrations, a configuration whose name matches the value.
- The configuration attached to the product.
- Your website's default configuration.
References are unique within a website and widget type, so the same reference can be reused across different widget types (e.g. standalone and carousel) without collision. If the attribute is omitted, the lookup starts at step 3.
data-ekoo-mode
Forces the widget rendering mode. The widget auto-detects SPA frameworks (Next.js, Nuxt, React, Vue, Angular, Sapper) and switches to SPA mode automatically. Set this to "spa" only if auto-detection fails, or "static" to force static rendering.
data-shadow-mode
Controls Shadow DOM encapsulation for the widget. The default "open" allows external CSS access to the widget internals, DevTools inspection and analytics tracking. Set to "closed" if you need full style isolation, preventing your page styles from affecting the widget and vice versa.
Usage Examples
Via HTML Attributes
1<script src="https://app.ekoo.co/widgets/widget-4.0.0-standalone.js"</script>23<ekoo-widget4 data-ekoo="abc123"5 data-ekoo-product-id="SKU-001"6 data-ekoo-locale="fr"7 data-ekoo-on-event="onEkooEvent"8></ekoo-widget>Via window.ekooOptions
1<script src="https://app.ekoo.co/widgets/widget-4.0.0-standalone.js"</script>23<script>4 window.ekooOptions = {5 websiteId: "abc123",6 widgets: [7 {8 nodeId: "ekoo-container", // string (element ID) or function returning an HTMLElement9 productId: "SKU-001", // string or function returning a string10 locale: "fr" // string or function returning a string (optional)11 }12 ]13 };14</script>1516<div id="ekoo-container"></div>Via Custom Element
The <ekoo-widget> element is an alternative to the <div> with data-ekoo attributes:
1<script src="https://app.ekoo.co/widgets/widget-4.0.0-standalone.js"</script>23<ekoo-widget4 data-ekoo="abc123"5 data-ekoo-product-id="SKU-001"6 data-ekoo-locale="fr"7></ekoo-widget>Attribute Precedence
Related Resources
- JavaScript API — Programmatic widget control functions
- Events Reference — All events emitted by Ekoo widgets