Interface IAnalyticsService
This IService is used to log IAnalyticsEvents for data analysts. Events that are logged via this service will be sent along to any instantiated IAnalyticsDispatchers for custom parsing / output.
Namespace: IdleKit.Analytics
Assembly: cs.temp.dll.dll
Syntax
public interface IAnalyticsService : IService
Methods
LogEvent(IAnalyticsEvent)
Log a single IAnalyticsEvent.
Declaration
void LogEvent(IAnalyticsEvent analyticsEvent)
Parameters
Type | Name | Description |
---|---|---|
IAnalyticsEvent | analyticsEvent | The event to log. This event should already be initialized and ready to log. |
LogEvent(Type, Action<IAnalyticsEvent>)
Log a single event of Type eventType
and run the initializeEventMethod
for
custom initialization. For a generic version of this method see LogEvent<TEvent>(Action<TEvent>).
Declaration
void LogEvent(Type eventType, Action<IAnalyticsEvent> initializeEventMethod)
Parameters
Type | Name | Description |
---|---|---|
Type | eventType | The type of event to log. |
Action<IAnalyticsEvent> | initializeEventMethod | The callback that will allow for event initialization. |
LogEvent<TEvent>(Action<TEvent>)
Log a single event of Type TEvent
and run the initializeEventMethod
for
custom initialization. For a non-generic version of this method see LogEvent(Type, Action<IAnalyticsEvent>).
Declaration
void LogEvent<TEvent>(Action<TEvent> initializeEventMethod)
where TEvent : IAnalyticsEvent
Parameters
Type | Name | Description |
---|---|---|
Action<TEvent> | initializeEventMethod | The callback that will allow for event initialization. |
Type Parameters
Name | Description |
---|---|
TEvent | The type of event to log. |
LogEvents(IEnumerable<IAnalyticsEvent>)
Log multiple IAnalyticsEvents. Useful for implementations that can handle batching events together.
Declaration
void LogEvents(IEnumerable<IAnalyticsEvent> analyticsEvents)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IAnalyticsEvent> | analyticsEvents | The events to log. These events should already be initialized and ready to log. |
SendPendingEvents()
Get all IAnalyticsDispatchers to output any cached IAnalyticsEvents immediately.
Declaration
void SendPendingEvents()
UpdatePendingEvents(Action<IEnumerable<IAnalyticsEvent>>)
Run a method on any cached IAnalyticsEvents in the IAnalyticsDispatchers before they are output.
Declaration
void UpdatePendingEvents(Action<IEnumerable<IAnalyticsEvent>> updateMethod)
Parameters
Type | Name | Description |
---|---|---|
Action<IEnumerable<IAnalyticsEvent>> | updateMethod | The method to run on cached events before they are sent. |