Hi,
I am looking for a solution to track route change in a single page application. I know there is an event “trackPageView”. trackPageView gets trigger only once on app load. I know there is link tracking event as well but that only works when the anchor tag inside of link has a “href”. If say the route of the application is changing via javascript and achor tag has a click event to trigger that then link tracking is not triggering an event for that.
<li><a onclick="goToCart()"></i>Cart</a> </li>
<li><a href="/cart"></i>Cart</a> </li>
So link tracking event will trigger only for second link which has a href.
Question-1 - So is there a way that the link tracking can happen for first link as well without manually calling trackLinkClick function?
In addition I want to track when a single page application route from one page to another
Question-2 - Do you have any best solution for that?