Global JavaScript and Integrations

Set up scripts, analytics, and redirects correctly the first time.

Quick setup: global custom code

Add site-wide scripts without breaking page behavior.

  1. Open your site in `/build`.
  2. Go to Site Settings -> Custom Code.
  3. Paste critical scripts in Header and non-critical scripts in Footer.
  4. Save and test on a published/static route.
  • Use Header for early setup scripts.
  • Use Footer for deferred widgets and non-critical scripts.
  • Use the Embed component for section-level code, not global code.

Quick setup: GA4 / GTM / Meta Pixel

Get tracking live quickly with settings-based setup.

  1. Open Site Settings -> Integrations.
  2. Choose the provider (GA4, GTM, Search Console, Meta Pixel).
  3. Paste the provider ID (for example `G-XXXXXXX` or `GTM-XXXXXXX`).
  4. Save, publish, then confirm events/tags in the provider dashboard.
  • Integration values are stored in `ROOT.props.integrations`.
  • Keeping IDs in settings makes audits and edits much easier.

Quick setup: redirects

Move URLs safely without losing traffic.

  1. Open Site Settings -> Redirects.
  2. Add `from` and `to` paths.
  3. Choose `permanent: true` for 301 or `false` for 302.
  4. Publish and verify old URLs land on the expected destination.
{
  "from": "/old-path",
  "to": "/new-path",
  "permanent": true
}

Pre-release checklist

Run this before publish to avoid broken tracking or routing.

  1. Verify provider IDs are correct in Site Settings.
  2. Confirm tags/scripts are present on a static page load.
  3. Test one conversion event or page-view in provider tooling.
  4. Verify each redirect with a real browser request.