SSR Integration: SEO & GEO
Render the transcript of your Ekoo audios and its structured data in the initial HTML of your pages. Crawlers that do not run JavaScript can then read them, and the widget keeps working as usual.
Why render the transcript on the server
The Ekoo widget is a JavaScript component: its player, transcript and JSON-LD only exist in the page once its script has run. A search engine that runs JavaScript can see them; a crawler that only reads the HTML it receives, like many AI engine crawlers, sees none of the audio content.
By rendering the transcript and its JSON-LD on your server, that text is present in the HTTP response itself. Only the text data moves to the server: the audio player is still rendered by the widget in the browser.
| Term | In this guide |
|---|---|
| SSR / SSG | Server rendering, on each request (SSR) or ahead of time (SSG, ISR). The transcript is in the HTML that is sent. |
| JavaScript widget | The Ekoo player, loaded and rendered in the browser. It does not change. |
| JSON-LD | Schema.org structured data (here an AudioObject) in a <script type="application/ld+json"> tag. |
| SEO | Ranking in classic search engines. |
| GEO | Generative Engine Optimization: making content readable by answer engines built on language models. |
Architecture
Your server calls the Ekoo API, then writes three elements into the page: the audio JSON-LD, its transcript and the widget slot. In the browser, the widget loads as usual, recognizes the JSON-LD already present and does not add a second one. This is the HTML your server must produce, whatever your framework:
1<!-- AudioObject JSON-LD: data-ekoo-audio-id tells the widget not to add a second one. -->2<script type="application/ld+json" data-ekoo-seo="server" data-ekoo-audio-id="AUDIO_ID">3 {"@context":"https://schema.org","@type":"AudioObject", "...": "..."}4</script>56<!-- Transcript: text escaped by the framework, next to the widget and never inside it. -->7<section class="ekoo-transcript">8 <details>9 <summary>Read the transcript</summary>10 <p>…</p>11 </details>12</section>1314<!-- The widget stays client-side: it becomes interactive once its script loads. -->15<div data-ekoo="YOUR_WEBSITE_ID" data-ekoo-product-id="PRODUCT_REF" data-ekoo-locale="en"></div>1617<script src="https://app.ekoo.co/widgets/widget-4.0.0-standalone.js" defer></script>The transcript goes next to the widget, never inside it
The <div data-ekoo> placeholder is replaced by the widget when it initializes: everything inside it disappears. And <ekoo-widget> renders its own content in a Shadow DOM with no slot for your elements: text placed inside it stays in the HTML but is never displayed. Put the transcript in a sibling element.
In a framework that manages the DOM itself (React, Next.js, Vue, Nuxt, Angular, Svelte), render the <ekoo-widget> element directly rather than the placeholder: the framework keeps control of the element, and a change of data-ekoo-product-id, data-ekoo-locale or data-ekoo-variant reloads the widget in place. In static HTML or PHP, the <div data-ekoo> placeholder is fine.
Turnkey examples by integration
The code lives on each integration page, in the server rendering tab, ready to copy:
- React with Next.js: App Router, Server Component.
- Svelte with SvelteKit: server load function and
<svelte:head>. - HTML / Vanilla JS: a script run after the build, no server needed.
- WordPress:
[ekoo_widget]shortcode and WooCommerce template. - Magento / Adobe Commerce: module with a view model, inside the full page cache.
- Nuxt: server side
useAsyncDataanduseHead. - Angular: Angular SSR, with the Ekoo response reused on hydration.
- Google Tag Manager, Commanders Act, Shopify (Liquid) and Ionic / Capacitor cannot render this way: each page explains why and what to do instead.
Fetching the data
One request is enough, the one the widget already uses: GET /ws/websites/{websiteId}/products/{productRef}?locale=…. It is public and needs no key. The type and variant parameters only change the widget appearance: they are not needed here.
- Locale required. Without
locale, the API returns audios in every language. Use exactly the value ofdata-ekoo-locale, neverauto: your server does not know the browser language, and the widget would then pick another audio than the one in your HTML. - Errors with HTTP 200. An unknown product answers
200with a{ "type": "ERR_DB_MISSING", … }body. Test thetypefield, not only the status. - Same audio as the widget. The widget plays the
data-ekoo-review-idaudio when set, otherwise the default audio (is_default). Pick the same one so the transcript matches what people hear. If the explicit ID cannot be found, both the widget and the samples pick the first playable audio, even when another audio is marked as default. - Published content only.
reviews[]only holds validated, active audios. Never display a transcript from any other source.
| API field | Use |
|---|---|
reviews[].id | Value of data-ekoo-audio-id |
reviews[].transcript | Transcript text and the transcript property |
reviews[].audio_url | contentUrl, and encodingFormat from its extension |
reviews[].locale | inLanguage |
reviews[].created_at | uploadDate, once converted: the value is a PostgreSQL timestamp, not ISO 8601 |
seo_name | name |
seo_description | description |
reviews[].user | author (first and last name) |
Displaying the transcript
A native <details> keeps the page tidy and needs no JavaScript: the text is in the HTML, and visitors open it with “Read the transcript”, by keyboard or mouse. The widget never touches this element, which stays in the page after it loads.
- Insert the transcript as text, escaped by your framework (
{review.transcript}in JSX,{{ … }}in Vue,esc_html()in PHP). Never usedangerouslySetInnerHTMLorv-htmlfor it. white-space: pre-linekeeps the line breaks of the text.- An empty or whitespace-only transcript adds neither an SSR transcript nor audio JSON-LD. Audio selection stays identical to the widget.
- Do not hide the block with CSS: the content must stay available to visitors.
The JSON-LD
The JSON-LD follows the one the widget produces, with only the fields the API provides. Example for one audio:
1{2 "@context": "https://schema.org",3 "@type": "AudioObject",4 "name": "Eau de parfum 50ml",5 "contentUrl": "https://cdn.ekoo.co/audios/abc.mp3",6 "encodingFormat": "audio/mpeg",7 "inLanguage": "en",8 "transcript": "I bought this perfume for my wife...",9 "uploadDate": "2026-03-14T09:12:00.123Z",10 "about": { "@id": "https://shop.example/products/eden#product" },11 "author": { "@type": "Person", "name": "Marie D." }12}aboutlinks the audio to your product. Add it only if your page already publishes aProductJSON-LD with an absolute@id, by passing that@idtobuildEkooAudioJsonLd(productJsonLdId) in the turnkey examples.- The API does not provide the duration: the server block leaves it out. Do not invent a duration, a date or an identifier.
- Serialize with
serializeJsonLd(orJSON_HEX_TAGin PHP):JSON.stringifydoes not escape<, and a transcript containing</script>would close the tag.
Avoiding duplicates
When the widget transcript button is enabled, the widget also adds an AudioObject JSON-LD. To keep it from adding a second one, your tag carries two attributes:
data-ekoo-seo="server": the block belongs to your page.data-ekoo-audio-id: theidof the audio inreviews[]. This is the key; the value ofdata-ekoo-seodoes not identify any content.
When the widget finds a readable block carrying the id of the audio it plays, it does not inject its own and removes the one it may already have added. When the ids differ, for instance when an experiment makes it play another audio, it adds its block for that other audio. It never removes a block of your page.
Other frameworks
Any server able to send an HTTP request can produce the expected HTML (see Architecture): call the API with an explicit locale, test the type field, pick the audio the way the widget does, write the JSON-LD with its two attributes then the escaped transcript, and place the widget next to them. Keep a short timeout, a cache, and a page that renders without Ekoo when the call fails.
Caching and updates
- Do not call Ekoo on every request: cache the page or the response for 5 to 60 minutes, depending on how often you publish.
- The Ekoo API itself caches its answers for up to an hour. An audio that is published, unpublished or whose transcript changes can therefore take up to an hour, plus your own cache duration, to appear on or disappear from your pages.
- Once a crawler has read the page, the previous version can stay in its index until its next visit.
- If you also cache the HTML, a page rendered without Ekoo (API unavailable or too slow) stays so until it is regenerated; the widget itself works normally.
Limits
A/B experiments
The server-rendered transcript is visible in every variation of an experiment, including the one where the widget is hidden. An experiment comparing the presence and the absence of the widget would be skewed: do not enable the server rendering of the transcript on the pages involved while that experiment runs. An experiment that only compares audios does not hide the widget, but some visitors then hear another audio than the transcript in your HTML; the widget adds that other audio’s JSON-LD. If the transcript must match what everyone hears, also leave the server rendering off during such an experiment.
Platforms without server calls
Shopify (Liquid cannot call an external API while rendering), Google Tag Manager, Commanders Act and no-code integrations cannot follow this guide. The widget stays fully functional there, with its browser-side JSON-LD when its transcript button is enabled.
What the server cannot know
- The browser language: the locale must be set by your page.
- The audio duration: only the widget knows it, once the audio has loaded, and only adds it to its own JSON-LD.
Verification
The initial HTML, the one a crawler receives, must contain the JSON-LD and the transcript:
1# HTML as a crawler receives it, before any JavaScript2curl -s https://shop.example/products/SKU-1234 > page.html34grep -q 'data-ekoo-audio-id' page.html && echo 'JSON-LD: ok'5grep -q 'class="ekoo-transcript"' page.html && echo 'Transcript: ok'Once the page has loaded, each audio must be described only once. In the browser console:
1// Browser console, once the widget has loaded2[...document.querySelectorAll('script[type="application/ld+json"][data-ekoo-seo]')].map((script) => ({3 source: script.dataset.ekooSeo === 'server' ? 'server' : 'widget',4 contentUrl: JSON.parse(script.textContent).contentUrl5}))6// Expected: each contentUrl appears once.- The widget shows up and plays the audio as before.
- With SPA navigation, move to another product and run the check again: the transcript, the JSON-LD and the audio played match the new product.
- Validate the JSON-LD with the Schema Markup Validator.
SEO and GEO best practices
- Keep the transcript visible to everyone, where the audio is.
- One page per language, with the matching locale and your hreflang tags.
- Keep each product page’s own canonical URL when its main content is distinct. Sharing an audio across products does not justify canonicalizing them to a single product page. Reserve that consolidation for duplicate or very similar pages.
- Do not rewrite the transcript: it must match what people hear.