intercom-rails
intercom-rails copied to clipboard
Is there a way to listen for outgoing message events on the client-side?
Version info
- intercom-rails version: 0.4.1
- Rails version: 6.0.3.1
Explanation
I am attempting to track every time a user sends us a message through the Intercom chat bubble on our site. I realize there is no hook for this in the JS SDK according to the docs. I only see onHide
, 'onShow
and onUnreadCountChange
events. However, I'm wondering if there's maybe another way to listen to outgoing HTTP requests from the Intercom iframe
that's inserted on our site which would allow me to track the outgoing requests sent to Intercom to create a conversation or message. Or maybe there is some private API I could use to get a callback when this happens? I want to track these events as part of our product analytics tracking and mixpanel integration to see how many messages each user is sending to our support team. Doing this client-side would be the easiest, most ideal solution. I tried overriding XMLHttpRequest.prototype.send
within the iframe's contentWindow
so that I could intercept requests, but that did not seem to work. Any other ideas? I know this is more JS related, but I didn't see a better place to submit this.
Hi there, Did you manage to find a solution to your problem? Regards
Unfortunately no