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
Copy file name to clipboardExpand all lines: articles/search/search-traffic-analytics.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,15 +13,15 @@ ms.date: 10/29/2024
13
13
14
14
# Collect telemetry data for search traffic analytics
15
15
16
-
Search traffic analytics is a pattern for collecting telemetry about user interactions with your Azure AI Search application, such as user-initiated click events and keyboard inputs. Using this information, you can determine the effectiveness of your search solution, including clickthrough rate and which query inputs yield zero results.
16
+
Search traffic analytics is a pattern for collecting telemetry about user interactions with your Azure AI Search application, such as user-initiated clickstream events and keyboard inputs. Using this information, you can determine the effectiveness of your search solution, including clickthrough rate and which query inputs yield zero results.
17
17
18
18
Instrumentation has the following parts:
19
19
20
20
+ Add a telemetry client
21
21
+ Modify a search request to include a correlation Id that maps search results to user actions
22
22
+ Create and send a custom event to Application Insights and use the visualization and reporting tools to view event data
23
23
24
-
This pattern takes a dependency on [Application Insights](/azure/azure-monitor/app/app-insights-overview) (a feature of [Azure Monitor](/azure/azure-monitor/)) to collect user data. It requires that you add instrumentation to your client code, as described in this article. Finally, you need a reporting mechanism to analyze the data. You can use any visualization tool that connects to Application Insights.
24
+
This pattern takes a dependency on [Application Insights](/azure/azure-monitor/app/app-insights-overview) (a feature of [Azure Monitor](/azure/azure-monitor/)) to collect user data. It requires that you add instrumentation to your application code, as described in this article. Finally, you need a reporting mechanism to analyze the data. You can use any visualization tool that connects to Application Insights.
25
25
26
26
> [!NOTE]
27
27
> The pattern described in this article is for advanced scenarios and clickstream data generated by code you add to your client. In contrast, service logs are easy to set up, provide a range of metrics including search terms, and can be done in the portal with no code required. We recommend that you enable logging for all scenarios. For more information, see [Collect and analyze log data](monitor-azure-cognitive-search.md).
@@ -32,32 +32,32 @@ This pattern takes a dependency on [Application Insights](/azure/azure-monitor/a
+ A rich client application providing an interactive search experience that includes click events or other user actions that you want to correlate to search result selections.
35
+
+ A rich client application providing an interactive search experience that includes clickstream events or other user actions that you want to correlate to search result selections.
36
36
37
37
## Identify relevant search data
38
38
39
39
To collect useful metrics for search traffic analytics, it's necessary to log some signals from the users of your search application. These signals signify content that users are interested in and that they consider relevant. For search traffic analytics, these include:
40
40
41
41
+ User-generated search events: Only search queries initiated by a user are interesting. Other search requests, such as those used to populate facets or retrieve internal information, aren't important. Be sure to only instrument user-initiated events to avoid skew or bias in your results.
42
42
43
-
+ User-generated click events: On a search results page, a click event generally means that a document is a relevant result for a specific search query.
43
+
+ User-generated clickstream events: On a search results page, a clickstream event generally means that a document is a relevant result for a specific search query.
44
44
45
-
In your application code, you should correlate these events with the search results returned from a given query. By linking search and click events with a correlation ID, you can gain a deeper understanding of how well your application's search functionality is performing.
45
+
In your application code, you should correlate these events with the search results returned from a given query. By linking search and clickstream events with a correlation ID, you can gain a deeper understanding of how well your application's search functionality is performing.
46
46
47
47
## Add search traffic analytics
48
48
49
49
For Azure AI Search, the Azure [portal](https://portal.azure.com) provides a Search Traffic Analytics page that has C# and JavaScript code snippets for adding a telemetry client, request headers, and properties necessary for custom log events.
50
50
51
51
> [!IMPORTANT]
52
-
> This page is currently outdated and references an obsolete client libary. The workaround is to use code snippets in the [azure-search-traffic-analytics](https://github.com/Azure-Samples/azure-search-traffic-analytics) GitHub repository. This article includes code snippets from the GitHub repository.
52
+
> The Search traffic analytics portal page is currently outdated and references an obsolete client libary. The workaround is to use code snippets from the [azure-search-traffic-analytics](https://github.com/Azure-Samples/azure-search-traffic-analytics) GitHub repository. This article includes code snippets from the GitHub repository.
53
53
54
54
:::image type="content" source="media/search-traffic-analytics/azuresearch-trafficanalytics.png" alt-text="Screenshot of the portal command and page for setting up Application Insights.":::
55
55
56
56
## Step 1: Set up Application Insights
57
57
58
58
Create an object that sends events to Application Insights. You can add instrumentation to your server-side application code or client-side code running in a browser, expressed here as C# and JavaScript variants. For other languages, see [supported platforms and frameworks](/azure/azure-monitor/app/app-insights-overview#supported-languages).
59
59
60
-
Server-side telemetry captures metrics at the application layer, for example in applications running as a web service on Azure, or as an on-premises app on a corporate network. Server-side telemetry captures search and click events, the position of a document in results, and query information, but your data collection will be scoped to whatever information is available at that layer.
60
+
Server-side telemetry captures metrics at the application layer, for example in applications running as a web service on Azure, or as an on-premises app on a corporate network. Server-side telemetry captures search and clickstream events, the position of a document in results, and query information, but your data collection will be scoped to whatever information is available at that layer.
61
61
62
62
On the client, you might have other code that manipulates query inputs, adds navigation, or includes context (for example, queries initiated from a home page versus a product page). If this describes your solution, you might opt for client-side instrumentation so that your telemetry reflects the extra detail. How this extra detail is collected goes beyond the scope of this pattern, but you can review [Application Insights for web pages](/azure/azure-monitor/app/javascript#explore-browserclient-side-data) for help with that decision.
Add instrumentation code to your client application.
107
107
108
-
### Correlate click events with search results
108
+
### Correlate clickstream events with search results
109
109
110
110
To correlate search requests with clicks, it's necessary to have a correlation ID that relates these two distinct events. Azure AI Search provides you with a search ID when you request it with an HTTP header.
0 commit comments