To get more out of Intercom, you can use our JavaScript API to do all sorts of useful things, like tracking what your customers do and customizing how the Messenger appears for them.
Important: If you’re looking for the actual code snippets from our JavaScript API, head over to our developer hub.
Here are just some examples of what our JavaScript API lets you do:
Track events
Events let you see when users take specific actions in your product, like when they use a feature or upgrade their subscription. Once you’ve set these up you can send the right messages to the right customers at the right time.
Integrate a single page app
If you have a single page app (characterized by very few page refreshes) you’ll need to integrate Intercom in a slightly different way. You need to use our API to to shut down the Messenger and restart it on each page.
Clear a user’s session
You’ll need to shut down Intercom to clear a user’s session when they log out of your app. This is a security measure that ensures users who share a computer and a browser won’t be able to view each other's conversations.
Customize the Intercom Messenger
You can customize how the Messenger appears for your users. For example, you can:
Choose to show or hide the launcher on specific pages. For example, if you’d like to provide VIP support for premium customers, you could show it for these users and hide it for everyone else.
Show your users’ unread message count. Customers will see how many messages they’ve left to read, even if they dismiss your notifications.
Pre-fill the Messenger with whatever content you like. For example, you could have a link appear when users open the Messenger.
To see the full list of JavaScript API methods and to grab the code snippets, head over to our developer doc now.