Add Google reviews to Next.js

Home › Guides › Next.js

In Next.js, scripts belong in your root layout using the Script component. Add the RepU script there once, and it loads on every page.

  • 1

    Copy your code

    In RepU, open your widget, choose light or dark and left or right, then click Copy next to the embed snippet.

  • 2

    Add it to your root layout

    Open app/layout.tsx. Import Script from next/script and add it inside the body, after the page content, with your src and data-repu attribute.

    Need more detail? See the official Next.js guide.

  • 3

    Redeploy your site

    Deploy your site, then open your live site to see your Google reviews.

Not showing?

Check your live site in a private window, not the editor or preview. A domain-locked widget only shows on your own domain.

Use the Script component, not a plain script tag in JSX. The script does not run again on client-side page changes, so reload the page to check.