Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在某个页面上发生了页面重定向,我需要在 Angular 5 应用程序中观察该页面重定向。我需要在它发生时获取 url。我如何/在哪里可以在 TrackJs 中添加这些东西。我应该使用哪个 API
您需要检测目标页面并记录引荐来源网址以便了解来源,或者在导航发生之前添加挂钩并检查目标。
对于钩子,您需要知道导航是如何发生的:单击、表单发布或 window.open。对于其中的每一个,您都可以添加一个 eventListener 来查找事件和日志。
track()当正确的事件发生时,您将使用标准的 TrackJS API 来处理自定义错误。
track()