Consider a single page application written in vanilla JS (to avoid framework-specific answers).
I have an app in which I load Intercom by default, but I want to hide the widget in specific pages.
That should be doable from Intercom itself, as shown in this article in their help center, but it doesn't really work in single page apps - the widget is shown no matter what is configured in Intercom.
One option would be to find the widget on page and hide it manually for the given pages, but that feels, sounds and tastes like a hack (it requires re-enabling the widget when going back to page where the widget is supposed to appear).
So, is there any good practice on how to do it for SPAs?
You can turn off the Intercom Messenger launcher in your Messenger settings. Just deselect the option to show the standard launcher to users or visitors. This disables the launcher in your app (or on your website) which allows your users to contact you, and see their past conversations with you.
To hide your location, hover over your avatar in the bottom left corner, and click your name: This will take you to your individual profile settings. From here, click 'Edit. ' Then select the 'Hide location from users' button and click 'Done.
Extend a warm welcome. You should greet customers by their first name by adding a first name variable. Introduce yourself. And don't forget to add a smiling avatar of your face to show the real person behind your product.
If you want to hide the intercom launcher programmatically, you can do this with the update
command.
To hide:
Intercom('update', {
"hide_default_launcher": true
});
And to show it again (when your next page loads, or the event is triggered that should show it).
Intercom('update', {
"hide_default_launcher": false
});
I used this exact technique in an angular SPA to hide it on screens where it was obscuring some buttons.
Intercom('update', {
"hide_default_launcher": true
});
$(".helpSupport").once().on("click", function() {
Intercom('update', {
"hide_default_launcher": false
});
Intercom('showMessages');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With