Skip to main content

Understanding Page-Level vs Global Code in Super

Learn how to use page-level and global code in Super with Head, Body, and CSS tabs to apply custom scripts and styling to specific pages or your entire sit

Written by Charlene
Updated over 2 weeks ago

When adding custom code in Super, it’s important to know where your code is placed, as this determines which parts of your site are affected.

Global Code (Site-wide)

Code added in the global Code Injection section will apply to your entire website.

Use this when:

  • You want consistent styling across all pages

  • Adding analytics scripts (e.g., Google Analytics)

  • Applying global JavaScript behavior

Note: Changes here will affect every page, so use with caution.

Page-Level Code (Specific Page Only)

If you want your code to apply only to a single page, you should add it directly in that page’s Code section.

Super provides three tabs for Code Section that applies to Global and Page Level Code

Head

  • Loads before the page renders

  • Best for:

    • Meta tags

    • Font imports

    • Scripts that must load early

Body

  • Applies to the visible content of the page

  • Best for:

    • HTML embeds

    • JavaScript interactions

    • Page-specific features

CSS

  • Used for styling that page only

  • Best for:

    • Layout adjustments

    • Design overrides

    • Fixing visual issues on a specific page

Example

If you add this in global code:

window.location.replace("https://example.com");

It will redirect your entire site.

If you add it in a page-level Body tab, only that specific page will redirect.

Key Takeaway

  • Global Code affects the entire site

  • Page-Level Code (Head, Body, CSS) affects only one page

If you only want changes on a specific page, always use the page-level Code section.

Did this answer your question?