Use with device-based Segment integration?
nicholaschiang opened this issue · 2 comments
Right now, I'm using Segment's device-based Intercom integration to load the Intercom script, identify users, and sync analytics events.
Do you have any suggestion for how to use this facade with Segment? Ideally, I'm thinking it'll work like this:
- Your facade stubs a global
window.Intercom
function that enables other scripts (like Segment) to call the Intercom API while the actual Intercom widget is still being fetched. - Segment calls your stubbed Intercom API whenever their analytics methods are called.
- Your facade dynamically fetches the Intercom widget and, once fetched, calls the actual Intercom API with the parameters received by your stubbed API (that way, events aren't lost while Intercom's widget is being fetched).
I've also opened a support ticket with Segment, because I'm guessing they'll be able to help more than you guys.
Also, if you're curious, the project I'm using this on is completely non-profit and open-source: tutorbookapp/tutorbook
Hey @nicholaschiang,
Do you have any suggestion for how to use this facade with Segment?
Um, not really, no! As far as I understand Segment either pings back to base to find the integrations that should be loaded, or you configure them to be loaded directly, is that right? I don't imagine it's possible to side-load one of their integrations and still have the event tracking system work as normal.
You'd probably have to crack into their source code and implement something custom, which seems risky if Segment change anything on their end.
I do know segment has server-side events relayed to third party services, if that's an option with intercom, maybe you can use react-live-chat-loader client side, then have segment funnelling events server side?
For now I'll close off this issue as it's not something we're able to directly support or help with. If you have any breakthroughs or additional information to share, please do so 👍