Sometimes, adblockers mean that I don't always track every visitor or user on my site. How can I check if an adblocker has prevented the Messenger script from loading?
There is a way to know if Intercom Javascript has been blocked. You can use Intercom('onUnreadCountChange') as part of the JavaScript API.
Â
It will trigger for pages that have Intercom loaded.
Â
var intercomLoaded = false;
Intercom('onUnreadCountChange', function(unreadCount) {
  intercomLoaded = true;
});
Â
Then the intercomLoaded variable could be used for any custom actions if needed.
Â
This still won’t capture all instances of the Messenger being available (e.g. if Intercom is loaded but there is no initialisation or if there is an issue with the initialisation) but it is an alternative if needed.
Reply
Join the Intercom Community 🎉
Already have an account? Login
Login to the community
No account yet? Create an account
Intercom Customers and Employees
Log in with SSOEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.