Skip to content

Commit

Permalink
report page views to snowplow
Browse files Browse the repository at this point in the history
  • Loading branch information
banders committed Apr 30, 2024
1 parent 9932a2e commit 6a12201
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,11 @@ router.beforeEach((to, _from, next) => {
});
});

router.afterEach((to, from) => {
// Tell snowplow that the URL changed. Snowplow will
// record the event as a 'PageView' associated with the
// new URL (which it reads from document.referrer).
window.snowplow('trackPageView');
});

export default router;

0 comments on commit 6a12201

Please sign in to comment.