Widget Integration Guide

    Embed Echoback testimonial widgets on any website with a single <iframe>. Widgets are server-rendered for fast loading — no JavaScript bundle required.

    Quick Start

    Copy the iframe snippet from your widget's Embed Codes tab in the Echoback dashboard. It looks like this:

    <iframe
      src="https://api.echoback.co/functions/v1/widget-embed?widgetId=YOUR_WIDGET_ID"
      width="100%"
      height="500"
      style="border: none;"
    ></iframe>
    AttributePurpose
    srcPoints to your widget. Replace YOUR_WIDGET_ID with the UUID from the dashboard.
    width / heightControls the visible area. Use 100% width for responsive layouts.

    The embed is server-rendered HTML — the response includes all feedback data and styling inline. No external scripts are loaded (except a small inline script for carousel navigation). Responses are cached for 5 minutes.

    Silent Mode

    By default, the widget displays a user-visible error message when loading fails (e.g. invalid widget ID or widget not found). If you prefer a blank iframe on error, append &silent=1:

    <iframe
      src="https://api.echoback.co/functions/v1/widget-embed?widgetId=YOUR_WIDGET_ID&silent=1"
      ...
    ></iframe>

    In silent mode the iframe renders a transparent, empty page on error instead of an error message. You can detect errors by checking the iframe's HTTP status (400 for invalid ID, 404 for not found, 500 for server error).

    Load Detection

    When the widget finishes rendering inside the iframe, it sends a postMessage to the parent page. This is more reliable than the iframe load event, which some browsers (notably Safari) fire inconsistently for cross-origin iframes.

    window.addEventListener("message", (event) => {
      if (event.data?.type === "echoback-widget-loaded") {
        // event.data.widgetId contains the widget UUID
        console.log("Widget loaded:", event.data.widgetId);
        // Show the iframe container, remove skeleton, etc.
    
        // Optional: send ack to stop retries
        const iframe = document.querySelector("iframe");
        if (iframe?.contentWindow) {
          iframe.contentWindow.postMessage({ type: "echoback-widget-ack" }, "*");
        }
      }
    });

    The widget retries the load message a few times to handle cases where your listener isn't set up yet. Send back an echoback-widget-ack message to stop retries (optional — extra pings are harmless).

    Security

    Content Security Policy

    If your site uses a Content-Security-Policy header, add the Echoback API domain to the frame-src directive:

    frame-src 'self' https://api.echoback.co;

    Sandbox Attribute

    Do not add a sandbox attribute to the iframe. Safari blocks cross-origin sandboxed iframes from loading, which will cause the widget to appear blank. The embed is server-rendered static HTML and does not need sandboxing.

    Responsive Tips

    Set width="100%" and wrap the iframe in a container that controls its max width. Use a fixed height appropriate for the widget type:

    Widget TypeSuggested Height
    Single250px
    Grid500px
    Carousel300px
    Marquee210px
    Store Badge230px

    A responsive wrapper pattern:

    <div style="max-width: 720px; margin: 0 auto;">
      <iframe
        src="https://api.echoback.co/functions/v1/widget-embed?widgetId=YOUR_WIDGET_ID"
        width="100%"
        height="500"
        style="border: none;"
      ></iframe>
    </div>

    Custom CSS

    Pro and Scale plans can add custom CSS in the widget builder. Styles apply to iframe embeds only (not the Raw HTML export).

    Available selectors

    SelectorElement
    .eb-cardTestimonial / feedback card
    .eb-quoteTestimonial / review text
    .eb-authorAuthor name and title
    .eb-avatarAuthor initials circle
    .eb-starsStar rating row
    .eb-verifiedVerified review badge
    .eb-sourceSource pill (App Store, Play Store, etc.)
    .eb-store-cardStore rating badge card
    .eb-marquee-trackMarquee scrolling container
    .eb-fadeGrid card entrance animation

    Example

    .eb-card {
      border-radius: 20px;
    }
    .eb-stars {
      display: none;
    }
    .eb-quote {
      font-style: italic;
    }

    JSON Feed

    Pro and Scale plans can fetch a widget's data as JSON and render it in their own markup. Other plans can use the iframe embed.

    curl "https://api.echoback.co/functions/v1/widget-data?widgetId=YOUR_WIDGET_ID"

    The response has three fields:

    FieldContents
    widgetid, type, and config (the builder settings)
    feedbackUp to 50 of the newest approved, unarchived items: id, content, contact_name, contact_title, rating, source. The feed does not apply maxItems or sortBy from config.
    storeRatingsStore badge and custom widgets only. One entry per connected store that has a rating: store (such as apple or android), rating, ratingCount. The feed does not apply config.selectedStores, so filter on it yourself.

    A widget that shows ratings from your Echoback feedback form also gets a jsonLd object (not custom templates or store badges). It counts only the items the widget itself would show (after maxItems), not every item in feedback. Store ratings are never in it, because Google's review-snippet guidelines say: "Don't aggregate reviews or ratings from other websites." The same guidelines say: "If you use AggregateRating, users should be able to see that aggregate rating on the page." If you add jsonLd to your page, show its rating and count too.

    Data responses are cached for 5 minutes. If you call the feed from the browser and your site has a Content-Security-Policy, add https://api.echoback.co to connect-src.

    Errors

    StatusCodeMeaning
    400INVALID_WIDGET_IDwidgetId is missing or not a UUID
    403PLAN_UPGRADE_REQUIREDThe widget's owner is not on Pro or Scale
    404WIDGET_NOT_FOUNDNo widget has this ID
    429RATE_LIMITEDMore than 100 requests per minute from one IP
    500INTERNAL_ERRORServer error. Retry later

    Without a Pro or Scale subscription, the feed returns 403, also during the free trial. A Pro or Scale subscription gets the data at any time, including one started during the trial. One exception: if the owner has no plan and the trial ended more than 7 days ago, the feed returns HTTP 200 with {"inactive": true, "items": []}.