Scope
Every script has one of three scopes:- Global: loads on every page of the site.
- Specific pages: loads only on the paths you list.
- Components: loads only on pages that have an element matching a CSS selector.
Specific pages
Add exact paths (/about), or use a trailing wildcard to match a whole section:
/blog/. Multiple entries are OR’d together, so the script loads if any one of them matches.
If the site is connected to Webflow, Cairn lists the site’s pages so you can pick them instead of typing paths.
Components
Give a CSS selector and the script loads only when a matching element is on the page:[data-video-player](a data attribute).hero-slider(a class name)#contact-form(an element ID)
Load order
Choose where the script tag lands in the document:- Head
- Body start
- Body end
Execution timing
For JS scripts, choose when the code runs:- Auto-detect: Cairn looks at the code. If it touches the DOM, it waits for DOM ready.
- Wait for DOM ready: always wait until the document is parsed.
- Execute immediately: run as soon as the script loads.
Scripts delivered as ES modules are always deferred by the browser, no matter what
load order or execution timing you pick. See ES modules.