Skip to main content
You can add your own code to your website: tracking scripts, chat widgets, custom styles, or whole sections written by you or by another AI tool. Custom code applies to the website you add it to.

Where to add code

Add site-wide code

  1. Open your website in the editor.
  2. Click Settings, then choose Custom Code.
  3. Paste your code into the header or body section.
  4. Save, then publish your site.
Header code loads before </head>. Use it for analytics and verification tags:
Header example
Body code loads before </body>. Use it for chat widgets and other scripts that don’t need to load first.
Google Analytics, Tag Manager, Clarity, Hotjar and Facebook Pixel have one-click connections in Settings > Integrations. See Setting up analytics.

Create custom blocks with ChatGPT, Claude or another AI

You can use your own ChatGPT, Claude or other AI account to generate a section of code, then add it to your page as a block. This is useful when you want a fresh creative direction, or when you’ve used up your Webfast AI credits.
1

Describe the block

In your AI tool, describe the block, what it’s for and the content it should include. Share your website’s fonts, colors and an example of its style.
Example prompt
2

Add a custom code block

In the Webfast editor, open the block picker and choose the custom code block option. Paste the code in.
3

Preview it

Check the block on desktop, tablet and mobile.
4

Test and publish

Click every link, button and interactive element, then publish.
Adding code directly like this doesn’t use Webfast AI credits. Your AI tool may have its own usage limits or charges.

Refine external code with Webfast AI

You can also paste code from ChatGPT, Claude or another tool into the Webfast AI chat. Explain where it should go and how it should fit your site, and Webfast AI integrates and refines it for you. This uses Webfast AI credits.

Edit an element’s code

To change the HTML of something already on your page, click Select, click the element, and open the Code tab in the Properties panel.

Best practices

  • Scope your CSS so it only affects your block.
  • Load third-party scripts with async or defer.
  • Check your code for errors before you paste it.
  • Keep a note of what each snippet does.

Troubleshooting

  • Code isn’t showing: make sure you saved and published, then clear your browser cache.
  • Something looks broken: open your browser’s developer console to look for errors, and remove the most recent snippet to see if that fixes it.
  • Page loads slowly: load scripts asynchronously and remove snippets you no longer use.