Add Google reviews to HTML, Astro, and other sites
Show your Google Business Profile reviews on any hand-coded or framework-built site by pasting two lines of HTML.
Copy your embed code
- Sign in to GBP Reviews and open your Review dashboard.
- Under Review outputs, open the list or carousel widget you want to show. Create one with Create review output if you haven't yet.
- Make sure the widget is Published, then click Copy JavaScript embed.
The code looks like this, with your own token in place of YOUR_WIDGET_TOKEN:
<script src="https://gbpreviews.app/embed/v1.js" defer></script>
<gbp-reviews token="YOUR_WIDGET_TOKEN"></gbp-reviews>
Plain HTML and static sites
Paste the embed code where the reviews should appear and deploy. The script can sit anywhere on the page, and you only need it once, even with several <gbp-reviews> tags.
Astro
Paste the embed code into a page or component as-is. Astro leaves scripts that have attributes such as defer untouched, so no extra configuration is needed.
React and Next.js
Render the element in JSX and load the script once, for example in your layout:
import Script from "next/script"
<Script src="https://gbpreviews.app/embed/v1.js" strategy="afterInteractive" />
<gbp-reviews token="YOUR_WIDGET_TOKEN"></gbp-reviews>
The widget renders inside its own Shadow DOM, so your CSS framework won't restyle it, and it won't restyle your page.
Content Security Policy
If your site sends a Content Security Policy, allow https://gbpreviews.app in script-src and connect-src, and https://developers.google.com in img-src for the Google logo.
If the reviews don't appear
- Check the live, published page. Many site editors don't run custom scripts while you're editing.
- Confirm the widget is still published in GBP Reviews and that your subscription or trial is active. Unavailable widgets render nothing rather than an error.
- If you rotated the widget's public URL, copy the new embed code. The old token stops working.
- Changes to a widget can take up to five minutes to show on your site.
- If your site or plan doesn't allow third-party scripts, use the Iframe compatibility option on the widget page instead. It needs no JavaScript on your site, but you set its height yourself.
Still stuck? Email [email protected] with the page address and we'll take a look.