Chat Javascript API - How to tell if agent online?

SOLVE
Mark1
Contributor

Hi,

 

I want to show certain content based on the availaibility of the Chat Agent i.e. if online show content A if offline show content B.

 

I can't see anything in the API so just seeing if anyone has any suggesions?

 

Cheers,

Mark

0 Upvotes
1 Accepted solution

Accepted Solutions
IsaacTakushi
Solution
HubSpot Employee

That makes sense, Mark.

 

Unfortunately, I can't think of any workarounds for that use case with the available methods.

The product team certainly wants to make the Conversations JavaScript API more robust and useful, though, so I recommend upvoting and commenting on this feature request. I just threw an upvote on there myself.

Isaac Takushi

Alumnus, HubSpot Developer Support

View solution in original post

0 Upvotes
3 Replies 3
IsaacTakushi
HubSpot Employee

Hi, @Mark1.

 

As you noted, the Conversations JavaScript API currently doesn't contain methods relating to agent status or activity. We'll have to think creatively.

 

If you set the chat launcher to hide when all agents are away (see screenshot below) then the widget.status will be false and you can use JavaScript to hide or reveal different content. Would something like that work?

 

Hide chat launcher.jpg

Isaac Takushi

Alumnus, HubSpot Developer Support
0 Upvotes
Mark1
Contributor

Thanks for you response. It would technically work however we still want Chat to be available to visitors even if all Agents are offline (so we can capture offline messages for follow up later). Any other Ideas?

0 Upvotes
IsaacTakushi
Solution
HubSpot Employee

That makes sense, Mark.

 

Unfortunately, I can't think of any workarounds for that use case with the available methods.

The product team certainly wants to make the Conversations JavaScript API more robust and useful, though, so I recommend upvoting and commenting on this feature request. I just threw an upvote on there myself.

Isaac Takushi

Alumnus, HubSpot Developer Support

View solution in original post

0 Upvotes