You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
John J Czaplewski edited this page Oct 7, 2013
·
2 revisions
By default, Google Analytics will use your current URI, and will only be triggered upon page load. This isn't ideal for applications that provide client-side routing with libraries like PathJS. To update your Google Analytics when different actions are hit via PathJS, you can use the following code:
// Define our update method.
function updateAnalytics(){
ga('send', 'pageview', document.location.href);
}
Path.map("#/users/:id").enter(updateAnalytics).to(function(){
// Code here
});