How to add custom code to a Framer site
Framer keeps third-party scripts in a list under the project’s settings. Each entry has a name, a placement and a run setting. Nothing you add there runs on the canvas, so every test happens on the published site.
Before you start
- A paid Framer plan with access to custom code
- The script from your tool, as a complete <script> tag
- The placement your tool asks for: head or body, start or end
- Permission to publish the project
Steps
- Open the Custom Code tabOpen Project Settings and select the Custom Code tab. Older Framer articles call the same place Site Settings.
- Add a script and name itClick Add Script. Give it a name you will recognise in six months, such as the tool it belongs to, then paste the tag.
<script defer src="https://example.com/tool.js"></script>An example tag. Paste the one your tool gave you. - Choose where the code is placedFramer offers the start or end of the head, and the start or end of the body. Most tools say which they want. You can also limit the script to certain pages; leave that alone for a site-wide tool.
- Choose how often it runsThe two options are Once and Run on every page visit. Follow your tool’s install instructions here. If they say nothing, ask the vendor before guessing.
- PublishPublish the site. Then open the live URL, because that is the only place the script exists.
Check it worked
- Open the published site in a private window and inspect the page in developer tools. The script element should sit where you placed it.
- In developer tools, open the Network tab, reload, and look for the script’s request.
What goes wrong
- Nothing happens in the canvas preview
- Framer does not load Custom Code in the canvas preview. Publish and test on the live page.
- There is no Custom Code tab to add scripts in
- Custom code needs a paid Framer plan that includes it. Check the project’s plan on Framer’s pricing page.
- The script is on the home page only
- Someone picked specific pages when adding it. Open the script’s entry and clear the page selection so it covers the whole site.
Checked on 2026-11-11 against Framer Help: How to add custom code.
Increase conversions on your Framer site by 20%
Dynamite personalizes the page for every visitor. Dynamite personalizes a Framer site from one script added in the Custom Code tab. Once it is live, you pick the headlines and buttons that may change and the visitors who get each version.
Dynamite for FramerQuestions
Does custom code work on a free Framer site?
Framer’s help article says custom code requires a paid plan with access to custom code. It does not list the plans, so check the current pricing page.
Why does my script not run in the Framer preview?
The canvas preview does not load Custom Code. Scripts run on the published site only.
Can I add a script to one page only?
Yes. When you add the script you can pick the pages it applies to.