Last active
January 30, 2026 20:25
-
-
Save cliffordp/1428be81a842d5b93c793d2d5b967007 to your computer and use it in GitHub Desktop.
Automatically open (and keep open) the GoHighLevel chat widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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> |
Author
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
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.