Intercom Chat Widget
You can quickly embed your Intercom chat widget into your Clove hub. In addition to the standard chat widget, we make it easy to use Intercom's Identity Verification feature to securely identify your users.
Retrieve Your Chat Widget Code
First, open the Intercom JS widget page on Intercom's settings. Visit "Installation > Web" to find the instructions that will apply to your hub. Choose "With Code" to see a script that looks like the following image:
You'll need your version of the script, because it comes with the widget ID pre-populated. We'll use this script in the final step.
Identity Verification
At the bottom of the Intercom Web Settings screen, there is a link to "Identity Verification". When you click it, you will see an "Identity verification secret" at the top of the page.
We'll use this secret in the final step. The "encrypt" function inside of a Clove template will take the secret as input and produce the output that Intercom expects. Important: this secret should be considered sensitive and never given out publicly.
Embed Your Chat Widget
Go to Clove's Theme Code Editor and open the "post_body" file. Paste the following code snippet at the bottom of the file. Make sure to swap out your code snippet from step 1 (just the bottom script part), your workspace ID, and your encryption secret.
When you save it and log into your hub, you will see the Intercom widget on the page. You will also see the widget if you are signed out, due to the "else" statement in the template. You can change the template if you only want signed-in users to see your chat.