- DotNET Client API
- Client class
- Inheritance and interfaces
- Getting documents
- Deleting documents
- File attachments
- Auto Boosting
- Best Bets
- Boosting with filters
- Boosting with weights
- Free text search
- Geo Search
- Including documents matching a filter
- More Like/Related
- Multiple searches in one request
- Searching over multiple types
- Pagination (Skip and Take)
- Related Queries
- Unified search
- Nested queries
- Customizing serialization
- Episerver Commerce-Find integration
- Episerver 7.5+
- Episerver 7/7.5 CMS
- Episerver CMS 6 R2
- Shell module
- Search statistics
This content is archived. See latest version here.
Last updated: Nov 16 2015
This topic describes tracking in Episerver Find, and explains how to enable and implement automatic and custom tracking for your solution.
Tracking stores statistical data about search queries submitted by site visitors, and search results that they clicked. The collected statistics can be analyzed, providing administrators with deeper insight into the search's efficiency. The statistics help identify areas of improvement and optimization, so more relevant content can be provided to visitors.
The recommended way to enable automatic tracking is to call Track() on the search query.
When using Unified Search, Track() enables tracking of a query and its hits. When using Track() on a non-Unified Search, only query tracking is enabled . Use custom tracking (explained below) to track hits with a non-Unified Search.
Note: The client side scripts used for tracking depends on having set the EPiServer.Framework.Web.RenderingTags in the page templates:
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<%@ Import Namespace="EPiServer.Framework.Web" %>
<%@ Import Namespace="EPiServer.Framework.Web.Mvc.Html" %>
<%= Html.RequiredClientResources(RenderingTags.Header) %>
To implement a custom tracking mechanism, use the StatisticsClient, which offers two methods: TrackQuery() and TrackHit().
Access the StatisticsClient as follows:
Use TrackQuery() to track the user query. It returns a TrackQueryResult with the TrackId.
Tracking querystring parameters
- _t_id: TrackId, returned from client.Statistics().TrackQuery(...)
- _t_q: The search query string
- _t_tags: Tags for categorization of the collected data. Normally contains site and language tags.
- _t_ip: Client IP address
- _t_hit.id: The expected format for a hit id. (hitId argument to StatisticsClient.TrackHit) is the type name used in the index and the ID of the document in the index separated by a slash. Example: "EPiServer_Templates_Alloy_Models_Pages_ProductPage/_cb1b190b-ec66-4426-83fb24546e24136c_en"
When SearchHit<T> objects (from GetResult) are available, combine the SearchHit.Type and SearchHit.Id properties for the appropriate search hit.
If you instead need to construct this value based on only the object that was indexed, use this syntax:
client.Conventions.TypeNameConvention.GetTypeName(myObj.GetType()) + "/" + client.Conventions.IdConvention.GetId(myObj)
- _t_hit.pos: The hit's ordinal position.
TrackHit() tracks a search hit; it provides click tracking. TrackHit() takes a query and hit ID as parameters. The hit id parameter format matches the _t_hit.id querystring parameter above.