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?
Best answer by Eric Fitz
View originalSometimes, 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?
Best answer by Eric Fitz
View originalThere 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.
Already have an account? Login
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.