Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active January 30, 2026 20:25
Show Gist options
  • Select an option

  • Save cliffordp/1428be81a842d5b93c793d2d5b967007 to your computer and use it in GitHub Desktop.

Select an option

Save cliffordp/1428be81a842d5b93c793d2d5b967007 to your computer and use it in GitHub Desktop.
Automatically open (and keep open) the GoHighLevel chat widget
<script>
// For a HighLevel webpage (funnel or website) that is meant to be a dedicated chatting area.
// Copy all of this and paste into your custom code, such as in the Footer Tracking area.
// This snippet: https://gist.github.com/cliffordp/1428be81a842d5b93c793d2d5b967007
// Source demo: https://10xmarketing.ai/10x-chatbot-widget
function openChatWidget() {
// Check if Chat Widget exists.
if (window.leadConnector && window.leadConnector.chatWidget) {
// If it exists, open it.
window.leadConnector.chatWidget.openWidget();
//clearInterval(intervalId); // Stop the loop
}
}
// Keep it open by re-opening it (if necessary) every 1000 milliseconds (1 second).
var intervalId = setInterval(openChatWidget, 1000);
</script>
@sean-mystyle
Copy link

Why is the clearInterval line commented out - this is going to run indefinitely/forever calling openWidget() every second?

Also demo page is a blank white page.

@cliffordp
Copy link
Author

cliffordp commented Jan 30, 2026

Just now saw your comment. That demo page wasn't mine - don't remember how I came across it.

This code is not what I personally use as-is (you might like this alternative instead), but that line is commented out because this script keeps it open indefinitely, as the title of this snippet says: Automatically open (and keep open) the GoHighLevel chat widget

iirc, this came from a webpage specifically meant to be something like example.com/chat - where the entire page is solely meant as a chat interface (like ChatGPT)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment