dzei
01/12/2026, 7:53 PMAI Evy
01/12/2026, 7:53 PMAI Evy
01/12/2026, 7:53 PMAI Evy
01/12/2026, 7:53 PMAI Evy
01/12/2026, 7:53 PMdata-dynamic attribute when deploying the Retell chat widget .
The chat widget supports a data-dynamic attribute that accepts a JSON object with custom key-value pairs . You can use JavaScript to dynamically update this attribute with the current page URL or other page-specific information .
Here's how you can implement this:
html
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
type="module"
data-public-key="YOUR_RETELL_PUBLIC_KEY"
data-agent-id="YOUR_CHAT_AGENT_ID"
data-dynamic='{"current_page": "homepage", "url": "<https://yoursite.com/%22%7D'>
></script>
To make this work in real-time as users navigate your site, you'd need to use JavaScript to update the data-dynamic attribute whenever the page changes. You can capture window.location.href or other page identifiers and pass them through this attribute, making the information available to your chat agent during conversations .