Overview
ScriptEmbed™ lets you load custom component scripts on your Webflow page by adding a single embed. It reads the component URL and name from the script tag’s attributes, then adds the component script to the page — but only if it hasn’t already been loaded. This helps avoid loading the same script multiple times when using the same component more than once.Features
- Prevents duplicate loading — Automatically checks if a component has already been loaded
- Simple setup — Add a single script embed to your Webflow project
- Flexible loading — Supports both external script URLs and inline template content
- Zero dependencies — Lightweight and fast-loading
- Webflow-friendly — Works seamlessly with Webflow’s embed system
Quick Start
Option A: Self-Contained Embeds (Recommended for Webflow)
Each embed includes everything it needs — just copy/paste wherever you need a component:- You don’t have access to global settings
- You want portable, self-contained embeds
- You’re embedding components in a CMS or page builder
Note: It’s safe to include this on multiple components — the loader only runs once.
Option B: Global Script + Lightweight Embeds
Add the loader once in your global settings (<head> tag):
- You have access to global settings
- You prefer cleaner, shorter embed code
- You’re managing a larger site with many components
Both options work identically — choose whichever fits your workflow best.
Loading Components
Add component scripts anywhere on your page using either method below.Usage
Method 1: External Script URL
Add a<script> tag with the required attributes:
Method 2: Inline Template
Use a<template> element with the script content. Recommended: Wrap your JavaScript code in <script> tags inside the template to preserve proper formatting and syntax highlighting in Webflow:
Attributes
rd-component-name— Unique identifier for your component (required)rd-component-src— URL to the external component script (optional if using template)
rd-component-src and a matching <template>, the external URL will be used.
How It Works
- On page load, the embed script scans for all
<script>tags withrd-component-name - For each component, it checks if it’s already been loaded (prevents duplicates)
- If not loaded, it either:
- Loads the script from the
rd-component-srcURL, or - Extracts and executes the content from a matching
<template>element
- Loads the script from the
- Tracks loaded components globally to prevent duplicate loading
Example
Support
Need help? Join our Slack community.Product Tracking
ScriptEmbed™ includes an extremely lightweight telemetry module that helps us understand product adoption patterns. This information allows us to focus our support efforts and prioritize product enhancements where they matter most. What We Track:- Product Identifier: The name of the product (e.g., “SCRIPT_EMBED”)
- Domain: The public hostname where the product is installed (e.g., “example.com”)
- No cookies, fingerprinting, or personally identifiable information
- Only runs on live, public domains (never on localhost or development environments)
- Single lightweight request sent once per page load
- Data is aggregated for internal analytics only
- Not used for advertising, marketing, or tracking