This is Intercom: the Business Messenger you and your customers will love
Sure, it does live chat. But there’s also bots, apps, product tours, and more like email, messages, and a help center that help you build relationships with your customers.
For more information visit: Intercom.com.
This plugin requires Craft CMS 4.0.0|5.0.0 or later.
You will need an Intercom trial or subscription in order to use this plugin. Or you can create a free developer account to build and test Intercom Messenger in development environment before signing up for a subcription.
For more information visit Intercom.com.
Go to the Plugin Store in your project’s Control Panel and search for "Intercom Messenger". Then click on the "Install" button.
# Go to project directory
cd /path/to/my/craft-project
# Tell Composer to load the plugin
composer require jimstrike/craft-intercom-messenger
# Tell Craft to install the plugin
./craft plugin/install intercom-messenger
Before enabling this plugin in Craft control panel you will need to setup and customize your Messenger on Intercom.
As a requirement you will need an Intercom trial or subscription in order to use this plugin. Or you can create a free developer account to build and test Intercom Messenger in development environment before signing up for a subcription.
Here's a collection of links that will help you get started with Intercom:
- Homepage
- About Messenger
- Find your app ID
- List trusted domains
- Identity verification
- Customize basics
- Developer account
- Help center
After you have setup and customized the Messenger on Intercom go to "Intercom Messenger" site settings in your Craft control panel, follow the instructions and enable it.
for Craft developers
Copy plugin's src/config.php
to your project's config
folder as intercom-messenger.php
and make your changes there to override default settings.
{##
# @param int|null siteId (defaults to current site ID)
# @param bool wrap (whether to wrap with <script>...</script> tag)
#
# @return string (Intercom Messenger chat script)
#}
intercom_messenger_script(int siteId = null, bool wrap = false)
craft['intercom-messenger'].script(int siteId = null, bool wrap = false)
Note: To avoid code duplication, script will be inserted only if plugin is disabled in
Intercom Messenger → Site Settings
or"config/intercom-messenger.php"
file.
{##
# Insert inside twig js tag.
#}
{% js %}
{{ intercom_messenger_script(currentSite.id)|raw }}
{#{ craft['intercom-messenger'].script(currentSite.id)|raw }#}
{% endjs %}
{##
# Insert before </body> ending tag.
#
# Passing the second parameter and setting it to true
# will wrap the code with html <script>...</script> tags.
#}
{{ intercom_messenger_script(currentSite.id, true)|raw }}
{#{ craft['intercom-messenger'].script(currentSite.id, true)|raw }#}
{##
# Insert before </body> ending tag.
#
# Omit the second parameter or set it to false
# and place the code inside html <script>...</script> tags.
#}
<script>
{{ intercom_messenger_script(currentSite.id)|raw }}
{#{ craft['intercom-messenger'].script(currentSite.id)|raw }#}
</script>
Note: Checks against "Enabled", "Sections" and "URL paths" won't be made as you are in control of your twig templates.
To enable a custom launcher add the tag attribute (see below) to the HTML element that you want the Messenger to open when clicked. Add as many custom launchers to your website as you wish.
You can choose to disable the standard launcher so that only your custom launcher appears.
{##
# Use one of the following twig functions
# to generate the tag attribute for the HTML element that you want
# the Messenger to open when clicked.
#}
{{ intercom_messenger_custom_launcher_selector() }}
{{ craft['intercom-messenger'].customLauncherSelector() }}
{# Example 1 #}
<a href="mailto:[email protected]" {{ intercom_messenger_custom_launcher_selector() }}>Support</a>
{# Example 2 #}
<a href="mailto:[email protected]" {{ craft['intercom-messenger'].customLauncherSelector() }}>Support</a>
{# The above examples will produce something like this #}
<a href="mailto:[email protected]" ns-intercom-messenger-custom-launcher>Support</a>
Note: You need to enable custom launcher in
Intercom Messenger → Site Settings
or"config/intercom-messenger.php"
file before you can use this feature.
To use this plugin with Craft 3 you need to install it from the latest v1.* tag version. View all tags.
# Go to project directory
cd /path/to/my/craft-project
# Tell Composer to load the plugin
composer require jimstrike/craft-intercom-messenger:1.0.3
# Tell Craft to install the plugin
./craft plugin/install intercom-messenger