Skip to main content

Getting Your Embed Code

The embed code is available from your agents deployment page in the Humanizing Agents dashboard.
1

Navigate to Your Agent

Open your agent from the Agents list in your workspace.
2

Go to Deployment

Click on the Deployment tab in the agent settings.
3

Copy the Embed Code

Copy the JavaScript snippet provided.

Basic Embedding

Add the following script to your website, typically just before the closing body tag:
<script
  src="https://chat.humanizing.com/embed.js"
  data-agent-id="YOUR_AGENT_ID"
  async
></script>
Replace YOUR_AGENT_ID with your actual agent ID from the dashboard.

Embedding Methods

The simplest method - works with any website:
<\!DOCTYPE html>
<html>
<head>
  <title>My Website</title>
</head>
<body>
  <\!-- Your website content -->

  <\!-- Chat Widget (place before closing body) -->
  <script
    src="https://chat.humanizing.com/embed.js"
    data-agent-id="YOUR_AGENT_ID"
    async
  ></script>
</body>
</html>

Method 2: Dynamic Loading

Load the widget after page load for better performance:
window.addEventListener("load", function() {
  const script = document.createElement("script");
  script.src = "https://chat.humanizing.com/embed.js";
  script.setAttribute("data-agent-id", "YOUR_AGENT_ID");
  script.async = true;
  document.body.appendChild(script);
});

Configuration Options

Configure the widget behavior using data attributes:
AttributeTypeDescription
data-agent-idstringRequired. Your agent ID from the dashboard
data-positionstringWidget position: bottom-right (default), bottom-left
data-open-on-loadbooleanAuto-open widget when page loads
data-hide-buttonbooleanHide the floating chat button

Verifying Your Installation

After adding the embed code:
  1. Clear your cache - Ensure you are seeing the latest version of your site
  2. Look for the chat button - A floating button should appear in the corner
  3. Click to open - The chat interface should open smoothly
  4. Test a conversation - Send a test message to verify the connection
Use your browser developer tools (F12) to check for any JavaScript errors if the widget does not appear.

Troubleshooting

  • Verify the agent ID is correct
  • Check that your agent is deployed (not in draft mode)
  • Ensure no JavaScript errors in the console
  • Check for CSS conflicts with z-index
  • Verify your domain is allowed in agent settings
  • Check that your site uses HTTPS
  • Ensure no ad blockers are interfering
  • The widget is designed to be responsive
  • Avatar panel is hidden on mobile (expected behavior)
  • Check viewport meta tag is present

Security Considerations

The widget only works on domains you have authorized in your agent settings. Unauthorized domains will see a connection error.
  • Always use HTTPS on your website
  • Keep your agent ID confidential (though it is visible in page source)
  • Configure allowed domains in the dashboard

Next Steps