Skip to main content

Hi Everyone, if there are any possibilities to embed a javascript intercom chat widget in Salesforce Lightning Community. All my attempts to do this faced that widget script blocking by the Salesforce Locker Service. Although it is indicated that Salesforce is fully supported by Intercom

 

Perhaps there is any best practice or documentation describing how to embed a script in Salesforce Lightning.

Hey @dmitry s​, our own community is built on Salesforce and we successfully installed the Intercom Messenger! However, the engineer who did this has since moved on from the company, sadly 😓 let me do some digging to see if I can find any documentation they may have shared with me.


Find that man! My job is on the line.


Hey @user172​, apologies for the delay in my reply. While we couldn't find the old document, one of our internal engineers has kindly put together this document which will guide you on how to install the Intercom Messenger on Salesforce Experience Cloud.


Hi Eric, thanks, we will use this approach.


Thanks so much for this Eric! Can you confirm that this is the list of all URLs that need to be added to trusted sites?


Also @eric f11​, I've actually now added all of those URLs however I'm getting the error message "Refused to connect to 'https://api-iam.intercom.io/messenger/web/ping#39; because it violates the following Content Security Policy directive: "connect-src 'self'". Please see attached my security settings here (the upload file button isn't working for me for some reason). As you'll see, https://api-iam.intercom.iois added as a trusted site so I'm a bit confused.


Hi Erick, we are have used your approach, but it was unsuccessful, we were also needed to redevelop js script for the widget, and add more URLs to the whitelist, not only for the community but in the SF setup also. But then we were able to see the widget, finally!!! 

Thank you so much for that!

 

However, could you share a full listing for the js script, because it is could not be seen fully on your images, but it definitely a different one than is listed in the official intercom documentation, and also the full list of URLs that needs to be whitelisted?

 

I just want to be sure that I'm using the correct script version or my changes is correct and the whitelist is contained all needed URLs


Please ignore! I've now managed to get it appearing by adding the URLs to the Content Security Policy Trusted Sites section in Setup.

 


Hey @george m11​, glad you were able to set this up! I wonder if you might be able to help @dmitry s​ with the issue they're experiencing?


We're still yet to test the user hash code as we're having some issues accessing the login pages in our Partial Environment. @dmitry s​ , we'll let you know when we make more progress on this. Did you manage to get anywhere debugging the issues? What errors were you getting?


@george m11​ do you have an example of the aura component you used? i'm working my way though this document with no success as have no detail on what 'intercom_messenger' aura component does


Bumping this up as I am looking to add Intercom to our Salesforce communities. I followed the instructions listed by Eric but I can only see Intercom when in the Salesforce Experience Builder, not while in the community as a user. I'm assuming this is a permission issue in Salesforce for the chatbot to be visible to users. Does anyone have a solution for what I am experiencing?


Hey @user172​, apologies for the delay in my reply. While we couldn't find the old document, one of our internal engineers has kindly put together this document which will guide you on how to install the Intercom Messenger on Salesforce Experience Cloud.

Hi Eric,

Can you let me know the link to the document mentioned?

Thanks!


Hey @user172​, apologies for the delay in my reply. While we couldn't find the old document, one of our internal engineers has kindly put together this document which will guide you on how to install the Intercom Messenger on Salesforce Experience Cloud.

Hey Eric, hope you are doing great, is there any way you could post again that doc? Just bumped with this discussion and not being able to find it 🤔 or maybe @Dmitry S @George M11  @Robert B12 could help with that?

Thank you!


Hey @Federico Delfino and @Tian Li 🤘

It looks like the doc Eric had linked was lost when we migrated our community platform to Gainsight. 

 

Here is the content from that doc 👇 

 

Setting up Intercom Messenger on Intercom Salesforce Community

Configure Intercom Messenger in Communities

To set up Intercom messengers in the communities, one possible solution we will be using is  Lightning Web Components (LWC) for the UI and Apex code on the server-side since lightning components are intended to modify their own scope (See Lightning Locker for a full explanation), to initialize the Intercom javascript we need to make use of Head Markup.

 

Configuring messenger in the community using LWC

 

  1. Create an LWC Project ‘intercom’, under which we will create LWC and server-side Apex code.
  2. On creating LWC, three files, intercom.html, intercom.js-meta.xml, and intercom.js, will be created under force-app/main/default/lwc

 

intercom.html

HHgDcfJ4dbqzcfnJSpbItnmciMvc2yX5qrCLLaMxxM8CsZ7ITmXUOgh84h98bi_tEfVQW5H1yPnvFZHqCnoyegUa1zDq68IFgpUvUv7BviL_Gzv4taofktuLvbgCxmSqIkt_JfV0sJjQeAjbXHFBT84

intercom.js-meta.xmlH7iiu1QUCzObC1AHeZ5feA2o6TUPltct0SZDzjPcy5-3Ibpo7d3VxqBjO0V4Z7N88_0reP6PyxP8Jtfx-vf9EJ6IbHL0ZuQKcbdYyfd___dmxxllHr_PeH_6qUVa2rDmDwCwhegqX9L-5wTgsdtV0oM

intercom.jsyBKksA4w51e_ENKX-1IUejyeZkAKlJCH3Ns6c4eTCENTBxKXkP_ueC62puMxR26nIOkGXCQpaAK8Db4nV4zICl4b_XjqWoL6wP7xxsGANg7qwkSD8BL09G3R457gEPi6nEPrPeY4mQ2h7zw4rIidTDY

 


Thank you @Matthew P11 !

Luckily I was able to solve this a while ago with some help from your support team but is great to have this publicly available to everyone here.


@Federico Delfino we are planning to do a similar implementation on our support portal built on Salesforce Experience Cloud. Could we connect to get more details around this implementation. 

 

@Matthew P11 could you share more details related to this asap.


Hey @user172​, apologies for the delay in my reply. While we couldn't find the old document, one of our internal engineers has kindly put together this document which will guide you on how to install the Intercom Messenger on Salesforce Experience Cloud.

Hi Eric, we are also planning to do a similar implementation. Do you mind sharing the link to the documentation on how to install the Intercom Messenger on Salesforce Experience Cloud? I couldn’t find it in your previous response.

Thank you!


Hey guys, anyone who implemented this happen to have it documented? I am planning on implementing the same. Do you mind sharing it? tia!


Hey guys, anyone who implemented this happen to have it documented? I am planning on implementing the same. Do you mind sharing it? tia!

FYI - I was able to solve this for non-authenticated users :)


Reply