Hi. Our website is built with Phoenix Liveview (el...
# support
b
Hi. Our website is built with Phoenix Liveview (elixir) and see that a standard JS SDK implementation doesnt cut it. As it doesnt listen to
pushstate
, that indicate a new page in some cases. Any advice on how to implement RudderStack in the most precice way in this case?
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
q
Hi Espen, Adding a listener on the popstate event and calling rudderanalytics.page in it might help. https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event developer.mozilla.org Window: popstate event - Web APIs | MDN Or
using
a custom event
Copy code
window.addEventListener("phx:page-loading-stop", () => {
  // When someone goes to a different live view page:
  window.rudderanalytics.page();
});
b
thanks, we'll check that out