Class MetricsConsentService
Service for managing telemetry consent levels for Umbraco analytics.
Inheritance
object
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public class MetricsConsentService : IMetricsConsentService
Constructors
View SourceMetricsConsentService(IKeyValueService, ILogger<MetricsConsentService>, IBackOfficeSecurityAccessor, IUserService)
Initializes a new instance of the MetricsConsentService class.
Declaration
public MetricsConsentService(IKeyValueService keyValueService, ILogger<MetricsConsentService> logger, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IUserService userService)
Parameters
| Type | Name | Description |
|---|---|---|
| IKeyValueService | keyValueService | The key-value service for storing consent settings. |
| ILogger<MetricsConsentService> | logger | The logger. |
| IBackOfficeSecurityAccessor | backOfficeSecurityAccessor | The back office security accessor. |
| IUserService | userService | The user service. |
Methods
View SourceGetConsentLevel()
Gets the current telemetry consent level.
Declaration
public TelemetryLevel GetConsentLevel()
Returns
| Type | Description |
|---|---|
| TelemetryLevel | The current TelemetryLevel configured for the system. |
SetConsentLevelAsync(TelemetryLevel)
Sets the telemetry consent level asynchronously.
Declaration
public Task SetConsentLevelAsync(TelemetryLevel telemetryLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| TelemetryLevel | telemetryLevel | The TelemetryLevel to set. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |