Sitewide JS

Sitewide JS allows you to run custom JavaScript across every page where the CustomFit.ai code snippet is installed. It acts as a centralized scripting layer that applies globally, rather than being tied to a specific experience.

The script executes before any experience changes are applied, ensuring that your global logic runs first. This makes it especially useful for preparing data, setting shared conditions, defining reusable functionality, or establishing variables that experiences can depend on.

Unlike experience-level scripts that are scoped to individual campaigns, Sitewide JS applies consistently across your website wherever CustomFit.ai is active. It helps maintain uniform behavior, reduces duplication, and gives you greater control over how your personalization and experimentation framework operates at a foundational level.

Sitewide JS runs only on live experiences, meaning it will not execute while experiences are powered off.

Where to Find Sitewide JS

To configure Sitewide JS in CustomFit.ai, follow these steps:

  1. Log in to your CustomFit.ai Dashboard.

  2. From the left-hand sidebar, click on Settings and then select CustomFit Setup.

  3. Inside the setup section, navigate to the Sitewide JS tab.

  4. Enter your JavaScript code in the provided editor.

  5. Save and publish your changes to apply them to live experiences.

Important Considerations

  • Changes apply globally once published.

  • Scripts execute only when experiences are live.

  • Since it runs before experiences, avoid conflicts with later modifications.

  • Keep logic optimized to prevent unnecessary overhead across pages.

Last updated