Remya CV
Remya CV

Reputation: 144

How to add custom logging to TrackJS

I have a page redirect happening on a certain page that I need to watch for in an angular 5 app. I need to get the url while it is happening. How / Where can I add such things in TrackJs. Which API should I be using

Upvotes: 1

Views: 118

Answers (1)

Todd H. Gardner
Todd H. Gardner

Reputation: 630

You'll either need to instrument the destination page and log the referrer so that you know the source, or add a hook before navigation occurs and check the destination.

For a hook, you'll need to know how the navigation happens: either a click, form post, or window.open. For each of these, you can add an eventListener to look for the event and log.

You'll utilize the standard TrackJS API to track() a custom error when the right event occurs.

Upvotes: 0

Related Questions