Skip to main content
Answered

Await trackEvent


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

Best answer by Jacob Cox

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?

View original
Did this topic help you find an answer to your question?

2 replies

Jacob Cox
Intercom Team
Forum|alt.badge.img+5
  • Sr. Technical Support Engineer
  • 441 replies
  • Answer
  • May 13, 2023

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?


  • Author
  • New Participant
  • 1 reply
  • May 16, 2023
Jacob Cox wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings