public interface AnalyticsFacade
Analytics instances only provides a best-effort to propagate events to the upstream receiver.
Analytics can be turned off by setting the system property "chronicle.analytics.disable=true" prior to acquiring any Analytics instances.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
AnalyticsFacade.Builder |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull AnalyticsFacade.Builder |
builder(@NotNull String measurementId,
@NotNull String apiSecret)
Creates and returns a new empty Builder that can be used to create an Analytic instance.
|
static boolean |
isEnabled()
Returns if Analytics is enabled.
|
default void |
sendEvent(@NotNull String name)
Sends an event to Google Analytics as identified by the provided event
name. |
void |
sendEvent(@NotNull String name,
@NotNull Map<String,String> additionalEventParameters)
Sends an event to Google Analytics as identified by the provided event
name including
the provided additionalEventParameters in the event. |
static Map<String,String> |
standardAdditionalProperties()
Creates and returns a new map of standard user properties.
|
static @NotNull AnalyticsFacade.Builder |
standardBuilder(@NotNull String measurementId,
@NotNull String apiSecret,
@NotNull String appVersion)
Creates and returns a new Builder that can be used to create an Analytic instance with
standard Chronicle settings including pre-configuration as per
standardEventParameters(String) and standardUserProperties(). |
static @NotNull Map<String,String> |
standardEventParameters(@NotNull String appVersion)
Creates and returns a new map of standard event parameters.
|
static @NotNull Map<String,String> |
standardUserProperties()
Creates and returns a new map of standard user properties.
|
default void sendEvent(@NotNull
@NotNull String name)
name.
Depending on settings and other conditions, the event may or may not be sent upstream. For example, some implementations may send a limited number of upstream events per time unit.
void sendEvent(@NotNull
@NotNull String name,
@NotNull
@NotNull Map<String,String> additionalEventParameters)
name including
the provided additionalEventParameters in the event.
Depending on settings and other conditions, the event may or may not be sent upstream. For example, some implementations may send a limited number of upstream events per time unit.
static boolean isEnabled()
@NotNull static @NotNull AnalyticsFacade.Builder builder(@NotNull @NotNull String measurementId, @NotNull @NotNull String apiSecret)
The builder can only create one single Analytic instance.
If isEnabled() returns false, then a NOP builder is returned.
measurementId - to use for reportingapiSecret - to use for reporting@NotNull static @NotNull AnalyticsFacade.Builder standardBuilder(@NotNull @NotNull String measurementId, @NotNull @NotNull String apiSecret, @NotNull @NotNull String appVersion)
standardEventParameters(String) and standardUserProperties().
The builder can only create one single Analytic instance.
measurementId - to use for reportingapiSecret - to use for reportingappVersion - to add to the event parametersstandardEventParameters(String) and standardUserProperties()(),
standardUserProperties()@NotNull static @NotNull Map<String,String> standardEventParameters(@NotNull @NotNull String appVersion)
appVersion - to include in the map@NotNull static @NotNull Map<String,String> standardUserProperties()
The map may contain properties like:
Copyright © 2024. All rights reserved.