Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active April 18, 2024 02:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/1428be81a842d5b93c793d2d5b967007 to your computer and use it in GitHub Desktop.
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment