Open Intercom chat on click

I have Intercom installed on my website through the “third-party trackers” settings with the HTML script in the .

However, following their Javascript API to open the chat using the following command:

Intercom ( ‘show’ );

I always get the following error:

Intercom is not defined

How can I import the Intercom library or so? Because this method used to work on other website builders.
Many many thanks

You cannot use Intercom in your Velo code.

Try to use wixWindow.postMessage() to tel your custom code added to the wix settting to receive the event, then the event will call Intercom(‘show’)

Wix Velo and intercom embed code is under different scope, so you cannot share the code without a bridge (event listener)

Thanks for your fast reply!

Is this something that could work?

window.addEventListener('intercom', (event) => {

Added in the code like this:

// We pre-filled your app ID in the widget URL: 'https://widget .intercom 
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget .intercom .io/widget/XXX';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
wixWindow.addEventListener('intercom', (event) => {

And on my home page :

$w.onReady(function () {
    wixWindow.postMessage("intercom", "certifio .io");

But nothing seems to happen and I don’t know how to debug it.
Many thanks

Post message should be in object, like {intercom: “open”}

Then on the HTML code

If the === “open”

Then call intercom open

No need fill in the target in the postMessage


With both these code snippets, it seems like nothing trigger the event

$w.onReady(function () {
$w.onReady(function () {

I’ve added a console.log in the HTML code to be sure but nothing happening:

window.addEventListener('intercom', (event) => {

Anyone to help on this one ?

I have the same problem.
Any chances you have found a solution? :sweat_smile: