# Embed the Chat Widget or AI Sales Agent on Any Website

_Developers_

Put CRMown's live chat or the AI Sales Agent on a site that is not built with Web Studio. Chats land in Conversations and visitors become contacts.

## Steps
1. Web Studio sites get the chat widget automatically when it is enabled — nothing to paste.
2. Other sites: open the widget in Web Studio → Chat, copy its embed code, and paste it before </body>.
3. AI Sales Agent: copy the two-line snippet from the agent's settings. Optionally tell the agent who the visitor is with setContext (for logged-in customers).

### AI Sales Agent
```
<script>window.CRMownAgentSettings={agentId:"WIDGET_ID"};</script>
<script async src="https://cdn.crmown.com/agent/v1/loader.js"></script>
```

### Pass a known visitor to the agent
```
CRMownAgent('setContext', { firstName: 'Ada', email: 'ada@example.com', company: 'Analytical', custom: { plan: 'pro' } })
```

### Chat widget
```
<script>
(function(w,d,s){
  w.CRMownChat={widgetId:"WIDGET_ID",apiUrl:"https://app.crmown.io"};
  var f=d.getElementsByTagName(s)[0],j=d.createElement(s);
  j.async=true;j.src="https://app.crmown.io/api/chat/widget.js";
  f.parentNode.insertBefore(j,f);
})(window,document,"script");
</script>
```
