How to add a script to a page?
What You’ll Learn
You’ll learn how to embed a custom script on a single page and how to request a global script installation across your site.
Why It Matters
Scripts add functionality—like tracking pixels or chat widgets—without rebuilding your site. Placing scripts correctly ensures they load only where needed or site-wide, keeping pages fast and accurate.
Step-by-Step Instructions
1. Embed a Script on a Single Page
- Open your page in the Morweb editor.
- Drag and drop an Embed widget onto the page.
- In the popup, paste the entire script you would like to add, including the
<script>…</script>
tags. - Click the green checkmark to save.
- Refresh the page (Ctrl + F5 or Cmd + Shift + R) to verify the script loads.
- If your script isn’t working, contact your Project Manager with the full script and the page URL.
2. Add a Global Script to the Site
- Gather your full script code, including the
<script>…</script>
tags and any placement instructions. - Contact your Project Manager and include the complete script and any directions (for example, “Place this in the
<head>
of every page”). - Your Project Manager will open a developer ticket to install the script into the site template so it loads globally.
Troubleshooting Tips
- My script didn’t appear after saving.
Make sure you refreshed the page (Ctrl + F5 or Cmd + Shift + R) and that you included the full
<script>
tags in the Embed widget. - I see a broken box or nothing at all.
Check for missing characters or line breaks in the code. Verify the script is intended for frontend embedding, not server-side only.
- Only part of the functionality loads.
Confirm your browser isn’t blocking mixed content (HTTP vs. HTTPS) and examine the console (F12) for JavaScript errors. Share any error messages with your Project Manager.