Answered

Is the a way to know when a post is open?


  • New Participant
  • 1 reply

I've tried to use getElementByClassName('intercom-post') but its not good enough selector. Is there an api like Intercom('onShow', f()) for posts (not the messenger)?

icon

Best answer by Evan P 21 July 2022, 12:49

View original

2 replies

Hey @noam​, 👋 thanks for reaching out! I'm one of the Support Engineers here @ Intercom! 👍

 

This isn't currently possible using the Intercom Javascript API. We don't have a method that would work in a similar way to what you described. Potentially if you knew the conditions for showing a post you could then preemptively prepare for this post to show. As an example if my post shows when a user has xyz attribute. I can then check in my backend if my user has xyz attribute then I know when they show on a page with Intercom installed the post should show. I hope that makes sense.

 

I know this isn't the most ideal workaround so if you'd like I can pass this along as a feature request to the product team so that we can potentially see this in the future, How does that sound? Thanks! 😊

Hi Evan,

Thanks for the quick response.

We are using the Intercom conditions, so every user will see the post once. We don't have an internal flag we can use, so unfortunately we can't use a backend hack.

We were trying to use a frontend solution by catching the post html element by document.getelementsbyclassname('intercom-post') but it wasn't working either due to rendering issue. (Maybe a frontend developer can help us figure this out?)

 

Our original issue was that the intercom post was rendered under our header, and we wanted it to be rendered over it.

As a quick solution, we've added z-index=1 to our main component, but this is a sort of an hack. We wanted to have for stable solution.

 

We would like to ask for this feature request of possible, or if someone has another quick solution for us that would be great!!

 

Thanks!

Reply