Skip to main content

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