Skip to main content

Install on Custom HTML or Framework Sites

Insert the embed code before the closing </body> tag in your layout file for proper deployment.

Script Placement

Add the embed script to your main layout file:

  • Static HTML: add before </body>
  • PHP templates: add in footer include
  • Framework layouts: add in global layout component

Example

<script src="https://your-witzo-script-url.js" data-widget-key="YOUR_WIDGET_KEY"></script>
Custom Sites script placement

SPA Considerations (Single Page Applications)

  • Ensure the script loads once globally.
  • Do not re-initialize on every route change.
  • Avoid dynamic injection on page transitions.

React / Next.js Notes

  • Add the script in _document.js (Next.js) before </body>.
  • Or use <Script> with strategy="afterInteractive".
  • Avoid placing the widget script inside individual components.

Important Notes

  • Script must load after page DOM is available.
  • If using strict Content Security Policy, allow the Witzo script domain.