Answered

Just showing the Intercom widget after boot without show/hide

  • 30 April 2024
  • 1 reply
  • 28 views

export async function bootIntercom(open = true) {
const app_id = window.intercomSettings?.app_id
await loadScript(`https://widget.intercom.io/widget/${app_id ?? 'XXXXXXX'}`)
window.Intercom('boot', window.intercomSettings ?? { app_id: 'XXXXXXX' })
// the intercom widget needs to be shown once for it to stay closed, in button shape
window.Intercom('show')
window.Intercom('hide')

if (open) {
window.Intercom('show')
}
}

Hello! We have Intercom integrated in our website and until now, relied on Users clicking on a Facade button to open and boot intercom. However, we want to get rid of that and just boot the messenger button widget on the bottom of the page automatically.

The only solution I can come up with is this. First “show” and then “hide”  to present the user with the button. 
Is this a bug? I think just calling “boot” should be sufficient to show the button?

 

If  `open` is true, the messenger opens with no issue.

Thanks in advance

icon

Best answer by mateusz.leszkiewicz 30 April 2024, 16:19

View original

1 reply

Userlevel 2
Badge +4

Hi Sascha, It’s Mat from the Support Engineering Team 😀

I would recommend ditching all JS methods altogether and paste the Installation snippet at the bottom of the BODY tag of your page.

In that way, you’ll have the ability to show/hide Messenger with the proper settings in the workspace.

Reply