We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.copilot.analytics.
Package com.vaadin.copilot.analytics
Class AnalyticsClient
java.lang.Object
com.vaadin.copilot.CopilotServerClient
com.vaadin.copilot.analytics.AnalyticsClient
Client for tracking features of Copilot
-
Field Summary
Fields inherited from class com.vaadin.copilot.CopilotServerClient
SERVER_URL_ENV
-
Method Summary
Modifier and TypeMethodDescriptionstatic AnalyticsClient
Get the singleton instance.
boolean
Check if tracking is enabled.
protected void
void
setEnabled
(boolean enabled) Set whether tracking is enabled.
void
setUserContext
(Map<String, String> userContext) void
Track event to copilot-server
Methods inherited from class com.vaadin.copilot.CopilotServerClient
buildRequest, getHttpClient, getLogger, getQueryURI, getServerBaseUrl, readValue, sendReactive, writeAsJsonString
-
Method Details
-
getInstance
Get the singleton instance.
Returns:
the singleton instance of the client, never null
-
setEnabled
public void setEnabled(boolean enabled) Set whether tracking is enabled.
Should only ever called from
CopilotIndexHtmlLoader
.Parameters:
enabled
- true if tracking should be enabled, false otherwise -
isEnabled
public boolean isEnabled()Check if tracking is enabled.
Returns:
true if tracking is enabled, false otherwise
-
setUserContext
-
track
Track event to copilot-server
Parameters:
event
- Event nameproperties
- Map of event properties -
sendRequest
-