How do I hide live chat on certain pages of my website, but keep it on others?

Return to top

2 Comments

  • Tom Derbyshire

    Is there a way to have the code on all pages but only show on certain pages so that the chat resumes if a user goes from a page with the chat widget to a page without the chat widget so we don't get cut off? Thanks!

    0
  • Erica Girges
    Zendesk Developer Advocacy
    Hi Tom!

    Thanks for posting your question to the Community. You could useon chat:unreadMessagesto listen for chat notifications coupled with window.location.pathname to track which page the user is on then toggle hide/show for the chat widget based on your needs. Here are the links to the how tohide/showthe chat widget.

    Another solution, you could just use z-index on the chat widget to move it from the front or back of the page. You'll still want to track chat notifications and location as well though to determine when to change the z-index value.

    Hope this helps!

    Erica
    0

Pleasesign into leave a comment.

Powered by Zendesk