The dashboard inside a client's admin page

On the left, a mock admin page for the imaginary coffee shop, with the Gaugemint dashboard framed in it. On the right, the code that does it.

Demo data, generated, not a real site. Every visitor, page and number below was invented by a script; nothing here was measured on a real site.

Northfield Coffee adminMock page for this demo
  • Orders
  • Products
  • Customers
  • Analytics
  • Settings

Analytics

app/admin/analytics/embed/page.tsx (9 lines, Next.js)
export default async function EmbeddedAnalytics() {
  if (!(await isAdmin())) notFound(); // your own admin check, first
  const src = process.env.GAUGEMINT_EMBED_URL; // the embed address from Gaugemint
  if (!src) return <p role="alert">GAUGEMINT_EMBED_URL is not set.</p>;
  return (
    <iframe src={src} title="Gaugemint stats" width="100%" height={720} loading="lazy"
      style={{ border: 0, maxWidth: 1100 }} referrerPolicy="no-referrer" />
  );
}
  1. On the site's page in Gaugemint, create a share link and list the origin of your admin page under Embed in another site.
  2. Put the embed address in GAUGEMINT_EMBED_URL on your server.
  3. Keep the page behind your own admin login. The address works for anyone who has it.

The menu on the left is a picture: its items go nowhere. Steps, an Express version, a key-based version and the security notes are in Embed stats in an admin page.

Back to the full demoFor agencies