https://discord.gg/botpress logo
iFrame Embed won't work in GoHighLevel
# 🤝help
m
Hello! We are trying to use the out-of-the-box embed code on a gohighlevel webpage, I'm pasting the different scripts in the right header/footer/body sections, and I get no errors in console, but the iframe won't show. Do you guys have any documentation or past help with other gohighlevel sites? I can't be the first one to come across this issue!
l
Hmmm I wonder if this is an issue on gohighlevel's side. I know I was having trouble with GoDaddy on my end.
Will try to read up a little on it and see if anyone similar had issues!
m
@loud-crowd-60573 so I AI-ed my way to a working re-arrangement of the script - it's a little in depth so I won't attach it here, but here is their overview of what the issue was: Good clue — if you can see a hidden bpMessagePreview iframe, the SDK is loading, but the main embedded webchat iframe isn’t mounting. That almost always means one of these: Target mismatch / conflicting targets You’re telling Webchat to embed into two different places (e.g., you pass both selector: "#webchat" and embeddedChatId: "bp-embedded-webchat"), or the ID doesn’t exist at the time it mounts. Result: preview iframe gets created, but the main iframe has nowhere to go. GHL re-renders the DOM after init, removing the mount node. The SDK thinks it mounted, but your container got replaced, so you end up with only the preview iframe left in the DOM (and it’s hidden by default). Duplicate snippets (two inject.js or two init() calls) fighting each other — one opens the preview, the other wipes the mount.
l
Interesting! So in the end, did you get it to work? After researching Gohighlevel on discord it seems many users were struggling with this as well!
m
yes! It did work after a lot of prompting! Do you want to see the code snippets it gave me?
l
Yes that would be awesome! If you ever have some spare time you could drop a mini thread in #tutorials for Botpress X GoHighLevel. I am sure the community would greatly 😄 (Only if you want to of course)
m
So the on page div's ID was changed:
I swapped out all of the ID's and client-specific info (I hope!) 😂
l
Awesome!!!!
thank you @miniature-eve-55794 Ill be sure to reference this in the future 😄
m
no problem, glad I could share!!
4 Views