IL.UmbracoSearch.Analytics
17.7.5.3
dotnet add package IL.UmbracoSearch.Analytics --version 17.7.5.3
NuGet\Install-Package IL.UmbracoSearch.Analytics -Version 17.7.5.3
<PackageReference Include="IL.UmbracoSearch.Analytics" Version="17.7.5.3" />
<PackageVersion Include="IL.UmbracoSearch.Analytics" Version="17.7.5.3" />
<PackageReference Include="IL.UmbracoSearch.Analytics" />
paket add IL.UmbracoSearch.Analytics --version 17.7.5.3
#r "nuget: IL.UmbracoSearch.Analytics, 17.7.5.3"
#:package IL.UmbracoSearch.Analytics@17.7.5.3
#addin nuget:?package=IL.UmbracoSearch.Analytics&version=17.7.5.3
#tool nuget:?package=IL.UmbracoSearch.Analytics&version=17.7.5.3
IL.UmbracoSearch.Analytics
Optional Search Insights for IL.UmbracoSearch. This package targets Umbraco 17 / .NET 10 only.
Enable Analytics
Enable SearchOptions.Analytics with exactly one engine:
builder.Services.AddUmbracoSearch(SearchOptions.Lucene | SearchOptions.Analytics);
// or
builder.Services.AddUmbracoSearch(SearchOptions.Azure | SearchOptions.Analytics);
Analytics decorates ISearchService; it does not change query/result semantics.
Completed searches may receive a TrackingReference. Capture is non-blocking and
stores only GUID UmbracoNodeKey values for impressions/clicks.
Captured searches also return an AnalyticsSessionToken. Store it in the caller
and pass it as SearchParameters.AnalyticsSessionToken on a later search to
group those executions as one Search session. The package does not expire
session tokens; omit the value to begin a new session. TrackingReference
remains distinct for every execution and must still be used for click tracking.
Session insights
The Search section includes an anonymous Sessions view. It reports activity
only within the selected reporting window: searches per session, refined-session
rate, paginated journeys, and frequent query-to-query refinements. It never
returns or displays AnalyticsSessionToken values.
Journey rows are paginated and only include recent query/click activity. Refinement
analysis is limited to the most recent 10,000 matching raw events and indicates
when a wide reporting window is sampled. These insights depend on raw retained
events and are not available beyond RawEventRetention.
Per-call capture opt-out is available through SearchParameters.CaptureAnalytics.
Set it to false on individual searches that must not be captured (for example,
server-generated/internal searches).
Consumer setup checklist
- Enable Analytics with exactly one engine.
- Configure analytics storage.
- Map click tracking endpoint (
UseSearchAnalyticsClicks). - Map backoffice management endpoints (
MapSearchAnalyticsManagement). - Apply a backoffice authorization policy for Search Insights access.
- Install and use the npm click helper package in your front end.
Configuration
The package binds options from SearchSettings:Analytics.
For backward compatibility, UmbracoSearch:Analytics is also accepted when
SearchSettings:Analytics is not present.
{
"ConnectionStrings": {
"UmbracoSearchAnalytics": "Server=...;Database=SearchAnalytics;..."
},
"SearchSettings": {
"Analytics": {
"Enabled": true,
"EnableBackgroundProcessing": true,
"CaptureQueryText": true,
"QueueCapacity": 2000,
"FlushInterval": "00:00:01",
"TrackingReferenceLifetime": "01:00:00",
"RawEventRetention": "90.00:00:00",
"SynonymFieldNames": ["searchTitle"]
}
}
}
Supported SearchSettings:Analytics options:
Enabled— set tofalseon preview/test servers to disable all capture on that nodeEnableBackgroundProcessing— set tofalseon delivery servers in a multi-server setup so only the designated master backend runs periodic tasks (retention purge); capture and ingestion are unaffectedCaptureQueryTextQueueCapacityFlushIntervalTrackingReferenceLifetimeRawEventRetentionConnectionString(explicit override)UseInMemoryStorage(tests/local experiments only)SynonymFieldNames
CaptureAnalytics is not an appsetting; it is a per-request flag on
SearchParameters (and the default HTTP SearchRequest) for selective capture.
Storage defaults:
- SQL Server is default.
- Connection resolution order:
SearchSettings:Analytics:ConnectionStringConnectionStrings:UmbracoSearchAnalyticsConnectionStrings:umbracoDbDSN
- If none are set, startup fails unless
UseInMemoryStorage=true.
Database migrations
Generate analytics migrations with EF tooling (dotnet ef); do not hand-author
migration files. Analytics uses its own migrations history table and does not
modify Umbraco tables.
Click endpoint and npm helper
Map the consumer-owned click endpoint:
app.UseSearchAnalyticsClicks();
Default path: /api/search/analytics/click
Install helper package:
npm i @ihorleleka/umbraco-search-analytics
Use the helper:
import { trackSearchResultClick } from '@ihorleleka/umbraco-search-analytics';
await trackSearchResultClick(
{ endpoint: '/api/search/analytics/click', consent: () => hasAnalyticsConsent() },
{
trackingReference: search.trackingReference,
nodeKey: item.nodeKey,
position: index + 1,
idempotencyKey: crypto.randomUUID()
});
Click payload:
trackingReference: from the search responsenodeKey: Umbraco content GUID (not numeric node ID)position: 1-based position shown to the useridempotencyKey: unique per click attempt
Endpoint outcomes:
202 Acceptedfor accepted click204 No Contentfor duplicate click400 Bad Requestfor invalid/expired/non-displayed click
The host owns endpoint authentication, transport security, rate limiting, and consent policy.
Backoffice management endpoints
Map Search Insights management endpoints:
app.MapSearchAnalyticsManagement(authorizationPolicy: "SearchInsights");
Default base path: /umbraco/api/search-analytics
If no policy is supplied, endpoints still require an authenticated Umbraco
backoffice user via BackOfficeAuthenticationType.
Example policy wiring:
builder.Services.AddAuthorization(options =>
{
options.AddPolicy("SearchInsights", policy =>
policy.AddAuthenticationSchemes(Constants.Security.BackOfficeAuthenticationType)
.RequireAuthenticatedUser());
});
SSR and hydration guidance
TrackingReference is generated per executed search call. If the same logical
search is executed in SSR and then re-executed during hydration, analytics will
record two executions.
To avoid duplicate analytics with the current implementation, reuse SSR search
results during hydration instead of issuing a second identical search call, or
set CaptureAnalytics = false on non-user-visible/server-generated searches.
You can also suppress analytics for specific replay/internal searches by setting
SearchParameters.CaptureAnalytics = false for those calls.
Multi-server deployments
In a load-balanced or multi-server setup, use Enabled and EnableBackgroundProcessing
to control per-node behaviour:
| Node type | Enabled |
EnableBackgroundProcessing |
What runs |
|---|---|---|---|
| Master / backoffice server | true (default) |
true (default) |
Migrations, retention, capture |
| Delivery server | true (default) |
false |
Capture only |
| Preview / test server | false |
(irrelevant) | Nothing |
EnableBackgroundProcessing = false skips all server-side processing on that node:
database migrations and retention purge. Only the master
(backoffice) server should run with it set to true.
Example delivery server appsettings:
{
"SearchSettings": {
"Analytics": {
"EnableBackgroundProcessing": false
}
}
}
Example preview/test server appsettings:
{
"SearchSettings": {
"Analytics": {
"Enabled": false
}
}
}
Safety when the feature is not activated
If IL.UmbracoSearch.Analytics is referenced but SearchOptions.Analytics is
never added during service registration, the package is inert:
- The database migration hosted service exits without running.
- No background workers start (capture queue, retention).
UseSearchAnalyticsClicks()andMapSearchAnalyticsManagement()map no routes and resolve nothing from the DI container.
Azure synonyms
Synonym management is Azure-only. Publication creates immutable versioned Azure synonym maps and refreshes active/indexing index definitions; it does not upload or reindex content documents.
Local Storybook preview for Search section FE
Use the local Storybook workspace to evolve Search-section UI and fake-data states without publishing a new package release.
Workspace path:
src/UmbracoSearch.Analytics.Storybook/
Run locally:
cd src/UmbracoSearch.Analytics.Storybook
npm install
npm run storybook
Build preview artifacts:
npm run build-storybook
The preview uses a Storybook-only fake-data provider. Runtime backoffice behavior remains unchanged: production continues to use authenticated Umbraco fetch flow and existing management endpoints.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- IL.AttributeBasedDI (>= 2.9.1.1)
- IL.UmbracoSearch (>= 17.7.5.3)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.0 && < 11.0.0)
- Umbraco.Cms.Web.Common (>= 17.0.0 && < 18.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 17.7.5.3 | 0 | 7/28/2026 |
| 17.7.5.2 | 0 | 7/28/2026 |
| 17.7.5.1 | 0 | 7/28/2026 |
| 17.7.4.8 | 0 | 7/27/2026 |
| 17.7.4.7 | 35 | 7/25/2026 |
| 17.7.4.6 | 34 | 7/25/2026 |
| 17.7.4.5 | 35 | 7/25/2026 |
| 17.7.4.4 | 40 | 7/25/2026 |
| 17.7.4.3 | 39 | 7/25/2026 |
| 17.7.4.2 | 35 | 7/25/2026 |
| 17.7.4.1 | 34 | 7/25/2026 |
| 17.7.3.8 | 42 | 7/25/2026 |
| 17.7.3.7 | 30 | 7/25/2026 |
| 17.7.3.6 | 45 | 7/25/2026 |
| 17.7.3.5 | 36 | 7/25/2026 |
| 17.7.3.4 | 46 | 7/25/2026 |
| 17.7.3.3 | 48 | 7/24/2026 |
| 17.7.3.2 | 36 | 7/24/2026 |
| 17.7.3.1 | 37 | 7/24/2026 |