Answered

Await trackEvent

  • 8 May 2023
  • 2 replies
  • 104 views

Hi, is there any way to wait until window.Intercom(‘trackEvent’) finishes? 

I’m tracking user’s logout event then use Intercom(‘shutdown’) to clean up the cookies and reset Intercom, but it always throws this error:

Uncaught TypeError: Cannot read properties of undefined (reading 'then')
    at frame-modern.422879eb.js:1:381486

icon

Best answer by Jacob Cox 13 May 2023, 22:30

View original

2 replies

Userlevel 4
Badge +5

Hi @tuanna1601 !

 

Any solution would be written by you outside of the Intercom product, itself. That said, I would think you would be able to use an async/await call wouldn’t you?

Have you tried that, yet?

Hi @tuanna1601 !

 

Any solution would be written by you outside of the Intercom product, itself. That said, I would think you would be able to use an async/await call wouldn’t you?

Have you tried that, yet?

Yes, I did try that, but after looking at the source code from intercom, window.Intercom(‘trackEvent’) doesn’t return a Promise, which I need to await on.

Reply