# SPA and live chat ignoring trackingView path

**URL:** <https://community.hubspot.com/t/spa-and-live-chat-ignoring-trackingview-path/15711>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [August 12, 2019, 1:24pm UTC](https://community.hubspot.com/t/spa-and-live-chat-ignoring-trackingview-path/15711 "2019-08-12T13:24:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomasz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomasz/32/101739_2.png) [@tomasz](https://community.hubspot.com/u/tomasz)\
**Post date:** [August 12, 2019, 1:24pm UTC](https://community.hubspot.com/t/spa-and-live-chat-ignoring-trackingview-path/15711/1 "2019-08-12T13:24:22Z")

</div>

Hi,

We have problem with single page application and selecting chatflow with depends on query parameter. We are not able to fire the proper chatflow.

var \_hsq = window.\_hsq = window.\_hsq || [];

\_hsq.push([‘setPath’, ‘/myploys?lang=en’]);

\_hsq.push([‘trackPageView’]);

Chat is completly ignoring query paramaters send with \_hsq.push(

window.HubSpotConversations.widget.load();

It is still loading bad chatflow.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [August 12, 2019, 9:26pm UTC](https://community.hubspot.com/t/spa-and-live-chat-ignoring-trackingview-path/15711/2 "2019-08-12T21:26:34Z")

</div>

Welcome, @tomasz.

From your description, it sounds like you’re using [`widget.load()`](https://developers.hubspot.com/docs/methods/conversations_api/widget_load) when you should use [`widget.refresh()`](https://developers.hubspot.com/docs/methods/conversations_api/widget_refresh). [`widget.load()`](https://developers.hubspot.com/docs/methods/conversations_api/widget_load) allows you re-render different chatflows on different page routes.

Also, neither `window.HubSpotConversations.widget.load()` nor `window.HubSpotConversations.widget.refresh();` should be included within the `_hsq.push()` method, which is used for the [Tracking Code API](https://developers.hubspot.com/docs/methods/tracking_code_api/tracking_code_overview). and not the [Conversations Live Chat Widget API](https://developers.hubspot.com/docs/methods/conversations_api/hubspot-conversations-javascript-api).

---

<div class="post-metadata">

**Author:** ![tomasz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomasz/32/101739_2.png) [@tomasz](https://community.hubspot.com/u/tomasz)\
**Post date:** [August 14, 2019, 8:14am UTC](https://community.hubspot.com/t/spa-and-live-chat-ignoring-trackingview-path/15711/3 "2019-08-14T08:14:30Z")

</div>

@IsaacTakushi I want to pass variable which are not visible in the url.

What you wrote about \_hsq.push is not true.

\_hsq.push() works perfectly with live chat because tracking and live chat share the context.

Example, code below sets contact data.

\_hsq.push([“identify”,{

email: user.email,

firstName: user.first\_name,

lastName: user.last\_name,

phone: user.phone

}]);

\_hsq.push([‘trackPageView’]);

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [August 19, 2019, 2:38pm UTC](https://community.hubspot.com/t/spa-and-live-chat-ignoring-trackingview-path/15711/4 "2019-08-19T14:38:24Z")

</div>

Hi, @tomasz.

Thanks for clarifying.

HubSpot live chat widgets use `window.location`, so they will not change unless the parameters are in the URL. It is not enough to pass the variables to [`setPath`](https://developers.hubspot.com/docs/methods/tracking_code_api/set_page_path) and then trigger [`widget.refresh()`](https://developers.hubspot.com/docs/methods/conversations_api/widget_refresh).
