使用 Application Insights 中的用户流分析用户导航模式Analyze user navigation patterns with User Flows in Application Insights

Application Insights 用户流工具

用户流工具可视化显示用户在网站的页面和功能之间导航的方式。The User Flows tool visualizes how users navigate between the pages and features of your site. 它非常适合解释以下问题,例如:It's great for answering questions like:

  • 用户如何从网站上的某个页面进行导航?How do users navigate away from a page on your site?
  • 用户在网站页面上单击了哪些内容?What do users click on a page on your site?
  • 网站中用户流失最多的地方在哪里?Where are the places that users churn most from your site?
  • 是否存在用户反复重复同一操作的位置?Are there places where users repeat the same action over and over?

用户流工具从你指定的初始页面视图、自定义事件或异常启动。The User Flows tool starts from an initial page view, custom event, or exception that you specify. 基于此给定的初始事件,用户流显示用户会话期间发生在其之前和之后的事件。Given this initial event, User Flows shows the events that happened before and afterwards during user sessions. 不同粗细的线显示用户遵循每条路径的次数。Lines of varying thickness show how many times each path was followed by users. 特殊的“会话开始” 节点显示后续节点开始会话的位置。Special Session Started nodes show where the subsequent nodes began a session. “会话结束” 节点显示有多少用户在上一个节点之后没有发送页面视图或自定义事件,并突出显示用户可能离开站点的位置。Session Ended nodes show how many users sent no page views or custom events after the preceding node, highlighting where users probably left your site.


Application Insights 资源必须包含页面视图或自定义事件才能使用用户流工具。Your Application Insights resource must contain page views or custom events to use the User Flows tool. 了解如何使用 Application Insights JavaScript SDK 将应用设置为自动收集页面访问次数Learn how to set up your app to collect page views automatically with the Application Insights JavaScript SDK.

首先,选择初始事件Start by choosing an initial event


若要使用用户流工具开始回答问题,请选择初始页面视图、自定义事件或异常作为可视化的起点:To begin answering questions with the User Flows tool, choose an initial page view, custom event, or exception to serve as the starting point for the visualization:

  1. 单击“用户在...之后的操作?” 标题中的链接,或单击“编辑” 按钮。Click the link in the What do users do after...? title, or click the Edit button.
  2. 从“初始事件” 下拉列表中选择页面视图、自定义事件或异常。Select a page view, custom event, or exception from the Initial event dropdown.
  3. 单击“创建图形” 。Click Create graph .

可视化的“步骤 1”列显示了用户在初始事件之后最常执行的操作,自上而下按频率从高到低排列。The "Step 1" column of the visualization shows what users did most frequently just after the initial event, ordered top to bottom from most to least frequent. “步骤 2”和随后的列显示了用户之后的操作,创建了用户在网站中导航的所有方式的图片。The "Step 2" and subsequent columns show what users did thereafter, creating a picture of all the ways users have navigated through your site.

默认情况下,用户流工具只会随机抽取网站最近 24 小时的页面视图和自定义事件。By default, the User Flows tool randomly samples only the last 24 hours of page views and custom event from your site. 可在“编辑”菜单中增加时间范围并更改性能平衡和随机抽样的精度。You can increase the time range and change the balance of performance and accuracy for random sampling in the Edit menu.

如果某些页面视图、自定义事件和异常与你无关,请单击要隐藏的节点上的“X” 。If some of the page views, custom events, and exceptions aren’t relevant to you, click the X on the nodes you want to hide. 选择要隐藏的节点后,单击可视化下方的“创建图形” 按钮。Once you've selected the nodes you want to hide, click the Create graph button below the visualization. 若要查看已隐藏的所有节点,请单击“编辑” 按钮,然后查看“已排除事件” 部分。To see all of the nodes you've hidden, click the Edit button, then look at the Excluded events section.

如果预期在可视化中看到的页面视图或自定义事件丢失:If page views or custom events are missing that you expect to see on the visualization:

  • 检查“编辑”菜单中的“已排除事件”部分。Check the Excluded events section in the Edit menu.
  • 使用“其他” 节点上的加号按钮在可视化中包括不太频繁发生的事件。Use the plus buttons on Others nodes to include less-frequent events in the visualization.
  • 如果用户未频繁发送你预期的页面视图或自定义事件,请尝试在“编辑” 菜单中增加可视化的时间范围。If the page view or custom event you expect is sent infrequently by users, try increasing the time range of the visualization in the Edit menu.
  • 确保将预期的页面视图、自定义事件或异常设置为由站点源代码中的 Application Insights SDK 收集。Make sure the page view, custom event, or exception you expect is set up to be collected by the Application Insights SDK in the source code of your site. 详细了解如何收集自定义事件。Learn more about collecting custom events.

如果想要查看可视化中的更多步骤,请使用可视化上方的“前面步骤” 和“后续步骤” 下拉列表。If you want to see more steps in the visualization, use the Previous steps and Next steps dropdowns above the visualization.

用户访问页面或功能后去了哪里,又单击了什么?After visiting a page or feature, where do users go and what do they click?


如果初始事件是页面视图,则可以通过可视化的第一列(“步骤 1”)快速了解用户在访问页面后紧接着执行了哪些操作。If your initial event is a page view, the first column ("Step 1") of the visualization is a quick way to understand what users did immediately after visiting the page. 尝试在用户流可视化旁的窗口中打开你的网站。Try opening your site in a window next to the User Flows visualization. 将你对用户如何与页面进行交互的期望与“步骤 1”列中的事件列表进行比较。Compare your expectations of how users interact with the page to the list of events in the "Step 1" column. 通常,页面上对你的团队来说看似无关紧要的 UI 元素可能会是页面中最常用的。Often, a UI element on the page that seems insignificant to your team can be among the most-used on the page. 这对于对网站进行设计改进而言可能是一个很好的起点。It can be a great starting point for design improvements to your site.

如果初始事件是自定义事件,则第一列显示用户在执行该操作后所做的操作。If your initial event is a custom event, the first column shows what users did just after performing that action. 与页面视图一样,请考虑观察到的用户行为是否符合你团队的目标和期望。As with page views, consider if the observed behavior of your users matches your team's goals and expectations. 例如,如果你选择的初始事件是“将物品添加到购物车”,请查看可视化中紧随其后是否出现了“前往结帐”和“完成购买”。If your selected initial event is "Added Item to Shopping Cart", for example, look to see if "Go to Checkout" and "Completed Purchase" appear in the visualization shortly thereafter. 如果用户行为与你的预期不同,请使用可视化来了解用户是如何被站点的当前设计所“困扰”的。If user behavior is different from your expectations, use the visualization to understand how users are getting "trapped" by your site's current design.

网站中用户流失最多的地方在哪里?Where are the places that users churn most from your site?

注意在可视化的列中突出显示的“会话结束” 节点,特别是在流的前期。Watch for Session Ended nodes that appear high-up in a column in the visualization, especially early in a flow. 这意味着许多用户可能会在遵循上述页面和 UI 交互的路径之后从网站流失。This means many users probably churned from your site after following the preceding path of pages and UI interactions. 某些流失是可预料的(例如在电子商务网站上完成购买后),但通常流失是网站存在设计问题、性能不佳或其他可以改善的问题的征兆。Sometimes churn is expected - after completing a purchase on an eCommerce site, for example - but usually churn is a sign of design problems, poor performance, or other issues with your site that can be improved.

请记住,“会话结束” 节点仅基于此 Application Insights 资源收集的遥测数据。Keep in mind, that Session Ended nodes are based only on telemetry collected by this Application Insights resource. 如果 Application Insights 未接收某些用户交互的遥测数据,则在用户流工具表示会话结束后,用户可能仍在通过这些方式与网站进行交互。If Application Insights doesn't receive telemetry for certain user interactions, users could still have interacted with your site in those ways after the User Flows tool says the session ended.

是否存在用户反复重复同一操作的位置?Are there places where users repeat the same action over and over?

查找可视化后续步骤中的被许多用户重复的页面视图或自定义事件。Look for a page view or custom event that is repeated by many users across subsequent steps in the visualization. 这通常意味着用户在网站上执行重复操作。This usually means that users are performing repetitive actions on your site. 如果发现重复,请考虑更改网站设计或添加新功能以减少重复。If you find repetition, think about changing the design of your site or adding new functionality to reduce repetition. 例如,如果发现用户对表格元素的每一行执行重复操作,则添加批量编辑功能。For example, adding bulk edit functionality if you find users performing repetitive actions on each row of a table element.

常见问题Common questions

初始事件表示事件首次出现在会话中,还是出现在会话中的任意时刻?Does the initial event represent the first time the event appears in a session, or any time it appears in a session?

可视化上的初始事件仅表示用户在会话期间首次发送该页面视图或自定义事件。The initial event on the visualization only represents the first time a user sent that page view or custom event during a session. 如果用户可以在会话中多次发送初始事件,则“步骤 1”列仅显示用户在初始事件的第一个实例之后的行为,而不是所有实例 。If users can send the initial event multiple times in a session, then the "Step 1" column only shows how users behave after the first instance of initial event, not all instances.

我的可视化中的某些节点太粗略。Some of the nodes in my visualization are too high-level. 例如,仅显示“已单击按钮”节点。For example, a node that just says “Button Clicked.” 如何将其细分为更详细的节点?How can I break it down into more detailed nodes?

使用“编辑”菜单中的“拆分依据”选项:Use the Split by options in the Edit menu:

  1. 在“事件” 菜单中选择要细分的事件。Choose the event you want to break down in the Event menu.
  2. 在“维度” 菜单中选择维度。Choose a dimension in the Dimension menu. 例如,如果已有一个名为“已单击按钮”的事件,请尝试使用一个名为“按钮名称”的自定义属性。For example, if you have an event called “Button Clicked,” try a custom property called “Button Name.”

后续步骤Next steps