"How to embed Google reviews on any website with HTML"

"Add reviews with a script or HTML fragment, understand how an iframe differs, and paste the right code into your website."

By Sorin Maxim · Founder, ReviewMix4 min read

"Title card showing HTML code beside a website review widget"
In short

"You can add Google reviews to a website with a widget service's script or HTML fragment. ReviewMix supports both methods, but not an iframe."

To embed Google reviews on a website, paste a widget service's script or HTML fragment into a custom HTML block. A script is the simplest option for most sites, while a server-fetched HTML fragment can place the review text directly in the page's HTML. ReviewMix provides both codes on every plan, including Free.

Can you embed Google reviews with plain HTML?

Yes, you can embed Google reviews with plain HTML by using an embed code supplied by a widget service. The code usually takes one of two shapes: a script tag that loads and renders the widget, or a short script that fetches an HTML fragment and inserts it into the page.

The script option keeps the code you paste short. The widget service handles the layout, theme and review content after the page loads.

An HTML fragment contains the rendered review markup. It can be fetched by the visitor's browser, or a developer can fetch it on the server while building or rendering the page.

Both options begin with code pasted into your site, but they differ in where the reviews are assembled and when they become part of the page.

Script tag, HTML fragment or iframe: what changes?

A script tag renders a widget inside your page, an HTML fragment inserts rendered markup, and an iframe displays another page inside a box. The best choice depends on styling control, loading behaviour, consent requirements and whether the review text must arrive in your page's own HTML.

  • A script tag can load asynchronously, so the rest of the page can continue loading while the widget is requested. Styling control depends on how the widget isolates its design.
  • A browser-fetched HTML fragment gives the host page rendered markup, but still needs JavaScript to request and insert it.
  • A server-fetched HTML fragment can arrive as part of the page's original HTML. Search engines then receive the review text with the rest of the page, and the visitor's browser does not need JavaScript to request it.
  • An iframe loads a separate page inside a fixed box. Its content is not part of the host page's HTML, and its height stays fixed unless a script resizes it.
  • The page shown inside an iframe can refuse to be framed. If it does, pasting its address into an iframe will not work.

Scripts and iframes can make browser requests to another service. Whether those requests set cookies or require consent depends on the service, so check the provider's behaviour and how to keep your consent banner working before publishing.

Why does ReviewMix not offer an iframe?

ReviewMix does not offer an iframe because its widget already has style isolation and automatic height inside the host page. It renders inside a closed Shadow DOM, which is a protected part of the page where the widget's styles cannot leak into your site and your site's styles cannot break the widget.

The widget's height follows its content, so there is no fixed iframe box to size or resize. ReviewMix pages also send X-Frame-Options: DENY, which tells browsers not to display those pages inside an iframe.

The supported routes are the loader script and the HTML fragment. The loader script draws the grid, list or Marquee layout (a continuously scrolling strip) in a light, dark or auto theme. The HTML fragment arrives as plain, unstyled markup, so your site's own CSS decides how it looks. ReviewMix hosts the service in the EU.

Which ReviewMix embed code should you use?

The ReviewMix loader script is the default choice for most websites. It loads asynchronously and picks up the latest stable widget version on the next page load.

The dashboard shows this code with your own widget key filled in:

<script src="https://cdn.reviewmix.eu/widget/loader.js" data-widget="YOUR-WIDGET-KEY" async defer></script>

The alternative fetches an HTML fragment from api.reviewmix.eu and inserts it into the page:

<div id="reviewmix-static"></div>
<script>
  fetch('https://api.reviewmix.eu/w/YOUR-WIDGET-KEY/html')
    .then(r => r.text())
    .then(html => document.getElementById('reviewmix-static').innerHTML = html);
</script>

A developer can request the same /w/YOUR-WIDGET-KEY/html URL on the server at build or render time. The reviews then arrive in the page's HTML without browser JavaScript. Each review includes its date and Google's "G" attribution badge, with the badge carried inline so it makes no extra request.

The ReviewMix dashboard shows both codes side by side on the widget page. Each widget works on the website registered to it: that domain and any subdomain, with a leading www ignored, plus localhost for testing. Pasting the code on a second domain shows nothing, which prevents someone from reusing a copied code on another site.

Free includes one Google business and one website. If you need coverage for more than one website, check the available plans on the pricing page before setting up the second site.

Where do you paste an embed code in a website builder?

Paste an embed code into the website builder's custom HTML or code block, not a text block. A custom HTML block runs the code, while a text block displays the code to visitors as text.

Place the block where the reviews should appear, publish the page, then open the live page to check the result. An editor preview may not behave in the same way as the published site.

ReviewMix's per-platform instructions have been tested on WordPress only. If your site uses WordPress, follow the tested WordPress widget steps. For another builder, look for its custom HTML or embed feature and verify the published page yourself.

Frequently asked questions

"Is the ReviewMix HTML embed free?"
"Yes. Both ReviewMix embed codes are available on every plan, including Free at €0 a month for one Google business and one website."
"Will the embed code work on a second website?"
"Not unless that website is registered to the widget. The code works on its registered domain and subdomains, with a leading www ignored, plus localhost for testing."
"Can I put ReviewMix reviews in an iframe?"
"No. ReviewMix pages send X-Frame-Options: DENY, so browsers refuse to show them in an iframe. Use the loader script or HTML fragment instead."

Related articles

More on widgets & websites and embed code, google reviews.

All articles

Your customers would review you. Ask them.

Start free — no card. Import your Google reviews and embed them today; upgrade when you want the printables kit, replies, daily refresh, or more businesses — or don't.

Free to start · Setup takes minutes · Hosted in the EU