load-widgets to render the right widget types per page. It also covers SPA handling and CSS custom properties for visual customization.
Quick Start
Three steps to get ratings and reviews on your site:- Include the script — load
voyado.jsvia GTM or a<script>tag. - Add HTML containers — place
<div>elements with the right CSS class anddata-product-idwhere you want widgets. - Call
load-widgets— tell the SDK which widget types to render.
Environments
Voyado provides two isolated environments. Each has its own script URL, backend, and data store — nothing is shared between them.Installation — via GTM (Recommended)
Most customers loadvoyado.js through Google Tag Manager. This keeps the script out of your codebase and lets you manage configuration, user identity, and widget loading entirely from GTM tags.
Load script, configure, and identify user
Create two Custom HTML tags in GTM that both fire on All Pages. The first loads the script and configures the session. The second identifies the logged-in user. Use the script URL that matches your target environment (see Environments). Staging: GTM tag: Voyado - Configuration Stagingvoyado() calls made before the script finishes loading are queued and replayed automatically, so tag ordering is not critical.
Replace {{DL - ...}} with your own GTM Data Layer variables.
Add the stub to your page (required)
The GTM tag above loadsvoyado.js asynchronously. This means your page code may call voyado('load-widgets', ...) before the script has finished loading — resulting in a ReferenceError: voyado is not defined.
To prevent this, add the following minimal stub to your <head> before the GTM snippet. It creates a queuing function that captures any calls made before voyado.js arrives, which the SDK replays automatically on bootstrap.
voyado() calls anywhere on the page are then safe regardless of GTM load timing.
Load widgets
Create additional Custom HTML tags for each page type. Fire them on the appropriate triggers (e.g. a DOM Ready trigger filtered by page path). Category / listing pages:SPA route changes (if applicable)
If your site is a Single Page Application, create a tag that fires on your virtual page-view trigger:Widget Containers (HTML)
Place<div> containers anywhere in your HTML. These containers are pure HTML — they cannot be injected by GTM. They must be part of your page templates.
Example values:
data-product-group-id="SKU"data-product-id="SKU-Green"data-variant-id="SKU-Green-Small"
Stars (PLP — product cards)
Compact star rating for product listing pages. Supports multiple instances per page via the class selector.voyado-stars--small for 16 px stars (default is 40 px).
Ratings (PDP — inline)
Inline star + score + count. Typically placed near the product title.voyado-ratings--small (16 px text), voyado-ratings--vertical (stacked layout), or both combined.
Badge (PDP — sidebar)
Large numeric score, stars, review count, and a “Review this product” CTA that opens the review popup.voyado-badge--compact for a smaller score (48 px instead of 78 px, CTA hidden).
Summary (PDP)
AI-generated sentiment highlights from customer reviews. Automatically hidden when there are no reviews.Reviews (PDP)
Full review list with sort dropdown, pagination, author, date, star rating, text, verified-buyer badge, thumbs up/down voting, and comment threads. Authenticated users can edit their own reviews.voyado-reviews--boxed wraps each review in a card.
Highlights (PLP / PDP)
A single AI-selected review excerpt with title, date, and “Powered by Voyado” footer. Lighter than the full Summary widget.Loading Widgets
voyado('load-widgets', [types])
Call after the widget containers are in the DOM. Only list the widget types present on the current page — listing absent types wastes DOM searches.
PLP:
stars, ratings, badge, summary, reviews, highlights.
voyado('reset-widgets')
Clears all rendered widgets. Call before a SPA route change, then call load-widgets again after the new view is rendered.
SPA Handling
If your site uses client-side routing (single page application), callreset-widgets before each navigation and load-widgets after the new content is in the DOM:
CSS Customization
All visual tokens are CSS custom properties on:root. Override them to match your brand.

