Installation guide

Next.js

1.Site analytics

  1. Open the site in Studio and copy the Embed snippet src, data-site, and data-key values.
  2. In the App Router, open app/layout.tsx (or your root layout).
  3. Add a deferred Script from next/script with strategy="afterInteractive" (or inject the same attributes via a raw script in the root layout).
  4. Set src to the tracker URL and pass data-site and data-key as data attributes.
  5. Deploy.
  6. Load a public route and confirm a visit in Site Analytics.

For the Pages Router, place the same Script in pages/_app.tsx or pages/_document.tsx so it loads once for every page.

2.Blog

  1. Open the site in Studio and go to Settings β†’ Domain.
  2. Connect blog.yourdomain.com, add the CNAME Studio shows, then verify.
  3. In the site header or nav, link Blog to https://blog.yourdomain.com.
  4. Optional: in next.config, redirect /blog and /blog/:path* to that host so older paths still land on the posts.
  5. To render posts inside the Next.js app instead, open Settings β†’ API and use the public list and post endpoints.