Leader24Leader24
🇬🇧

Embed Code

How to get and install the widget embed code

The embed code is the JavaScript script that adds the widget to your site.

Get the Code

  1. Go to Widget in the dashboard
  2. Select your widget
  3. Click Embed Code
  4. Copy the displayed code

Standard Code

The code to copy and paste:

html
<script>
  window.Leader24WidgetConfig = {
    agentId: 'YOUR_AGENT_ID',
    apiUrl: 'https://api.leader24.ai'
  };
</script>
<script src="https://api.leader24.ai/widget-public/YOUR_AGENT_ID/widget.js" async></script>

Where to Insert It

Paste the code before the closing body tag:

html
<!DOCTYPE html>
<html>
<head>
  <title>Your site</title>
</head>
<body>
  <!-- Your site content -->

  <!-- Leader24 Widget - insert before closing body -->
  <script>
    window.Leader24WidgetConfig = {
      agentId: 'YOUR_AGENT_ID',
      apiUrl: 'https://api.leader24.ai'
    };
  </script>
  <script src="https://api.leader24.ai/widget-public/YOUR_AGENT_ID/widget.js" async></script>
</body>
</html>

Customization

Configure from Dashboard

All customization options (colors, position, messages, avatar, theme, etc.) are configured from Dashboard → Widget → Settings.

Changes apply automatically without needing to change the code on your site.

Specific Platforms

WordPress

  1. Go to Appearance > Theme Editor
  2. Open footer.php
  3. Paste the code before closing body
  4. Save

Or use a plugin like "Insert Headers and Footers".

Shopify

  1. Go to Online Store > Themes
  2. Click Actions > Edit code
  3. Open theme.liquid
  4. Paste the code before closing body

Wix

  1. Go to Settings > Custom Code
  2. Click + Add Code
  3. Paste the code
  4. Select "Body - end"

Squarespace

  1. Go to Settings > Advanced
  2. Click Code Injection
  3. Paste in the Footer field

Verify Installation

After installation:

  1. Reload the page
  2. You should see the widget icon in the corner
  3. Click to open the chat
  4. Test by sending a message

Common Problems

Widget doesn't appear

  • Verify agentId is correct
  • Check browser console for errors
  • Make sure the widget is active in the dashboard

Widget appears but doesn't respond

  • Verify the agent is active
  • Check network connection
  • Check logs in the dashboard

Security

Important

  • The agentId is public and visible in source code
  • Don't include sensitive data in the configuration
  • Rate limiting is enabled by default to prevent abuse

Next Steps

  • Customize appearance from the dashboard
  • Monitor conversations
  • Analyze metrics
© 2026 Leader24.