# Chatflow

**URL:** <https://community.hubspot.com/t/chatflow/83739>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [June 20, 2023, 12:27pm UTC](https://community.hubspot.com/t/chatflow/83739 "2023-06-20T12:27:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DR29](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@DR29](https://community.hubspot.com/u/DR29)\
**Post date:** [June 20, 2023, 12:27pm UTC](https://community.hubspot.com/t/chatflow/83739/1 "2023-06-20T12:27:06Z")

</div>

In an effort to integrate Chatflow with my web application, I included the embed code to index.html. I added a few target rules to the chat flow. The login page’s chatflow was enabled by me. After logging in, I disabled the conversation flow on the home page. However, it remains after logging in. When I restart the page, it is gone. I updated the chatflow targets to include this rule. My application is single page application(React).

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 21, 2023, 5:26pm UTC](https://community.hubspot.com/t/chatflow/83739/2 "2023-06-21T17:26:56Z")

</div>

Hey, @DR29 👋 Thanks for your question. Have you already tried using the [Conversations JavaScript API](https://legacydocs.hubspot.com/docs/methods/conversations_api/hubspot-conversations-javascript-api) to try to control the behaviour?

Something similar to:

```lia-code-sample
{
 if (location.pathname === "/home") {
 window.HubSpotConversations.widget.remove();
 } else {
 window.HubSpotConversations.widget.load();
 }
 }

```

If this approach doesn’t work, please share any details you can, as this helps the community to better assist you.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![DR29](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@DR29](https://community.hubspot.com/u/DR29)\
**Post date:** [June 28, 2023, 4:12pm UTC](https://community.hubspot.com/t/chatflow/83739/3 "2023-06-28T16:12:41Z")

</div>

[@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) I used the one below. This one is ideal for me. But how do I customize the popup and other types of forms like this?

useEffect(() =\> {

if (window.HubSpotConversations && window.HubSpotConversations.widget) {

window.HubSpotConversations.widget.refresh();

}

}, [history.location.pathname]);
