Add custom code to the <head> and <body>

Add custom code to the <head> or <body> when a native integration is not enough.


Some external services provide code snippets that must be added directly to the website. You can add these snippets from the site customization settings.


Use this option when there is no native integration for the service, when the provider gives you a specific verification tag, or when the code cannot be managed through Google Tag Manager.



Add code to the <head>


The <head> is used for code that must load before the visible page content.


Common examples include:


  • Verification tags.
  • Metadata snippets.
  • Tracking scripts that must be loaded early.
  • External stylesheets or font scripts.
  • Preconnect or preload tags.



Add code to the <body>


The <body> is used for code that should load inside the page body, usually near the end of the page.


Common examples include:


  • Scripts that need the page content to exist before running.
  • Third-party embeds.
  • noscript tags.
  • Widgets or snippets provided by external services.



Use with care


Custom code is more flexible than a native integration, but it also carries more risk. Before adding custom code, check whether the same service is already connected through a native integration or Google Tag Manager.


A broken snippet can affect the public website, and external scripts can impact performance, consent behavior, or tracking accuracy.




Review after saving


After saving custom code, review the site in preview or on the published website, depending on how the code is expected to work. Check that the script loads correctly and that it does not duplicate another integration.



Prefer native integrations or Google Tag Manager when they cover the use case. Use custom code only when the snippet needs to be added directly to the site.

Updated on: 11/09/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!