Class TrackerConfiguration
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
boolean
The Matomo Tracking HTTP API endpoint, for example https://your-matomo-domain.example/matomo.phpThe timeout until a connection is established.The authorization token (parameter token_auth) to use if not specified explicitly.The default ID of the website that will be used if not specified explicitly.The hostname or IP address of an optional HTTP proxy.The corresponding password for the basic auth proxy user.int
The port of an HTTP proxy.If the HTTP proxy requires a username for basic authentication, it can be configured here.The socket timeout (SO_TIMEOUT
), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.int
The thread pool size for the async sender.A custom user agent to be set.int
hashCode()
boolean
Disables SSL certificate validation.boolean
Disables SSL host verification.boolean
Allows to stop the tracker to send requests to the Matomo endpoint.boolean
Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code.toString()
void
validate()
Validates the auth token.
-
Method Details
-
validate
public void validate()Validates the auth token. The auth token must be exactly 32 characters long. -
builder
-
getApiEndpoint
The Matomo Tracking HTTP API endpoint, for example https://your-matomo-domain.example/matomo.php -
getDefaultSiteId
The default ID of the website that will be used if not specified explicitly. -
getDefaultAuthToken
The authorization token (parameter token_auth) to use if not specified explicitly. -
isEnabled
public boolean isEnabled()Allows to stop the tracker to send requests to the Matomo endpoint. -
getConnectTimeout
The timeout until a connection is established.A timeout value of zero is interpreted as an infinite timeout. A `null` value is interpreted as undefined (system default if applicable).
Default: 5 seconds
-
getSocketTimeout
The socket timeout (SO_TIMEOUT
), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.A timeout value of zero is interpreted as an infinite timeout. A `null value is interpreted as undefined (system default if applicable).
Default: 5 seconds
-
getProxyHost
The hostname or IP address of an optional HTTP proxy.proxyPort
must be configured as well -
getProxyPort
public int getProxyPort()The port of an HTTP proxy.proxyHost
must be configured as well. -
getProxyUsername
If the HTTP proxy requires a username for basic authentication, it can be configured here. Proxy host, port and password must also be set. -
getProxyPassword
The corresponding password for the basic auth proxy user. The proxy host, port and username must be set as well. -
getUserAgent
A custom user agent to be set. Defaults to "MatomoJavaClient" -
isLogFailedTracking
public boolean isLogFailedTracking()Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code. Defaults to false. -
isDisableSslCertValidation
public boolean isDisableSslCertValidation()Disables SSL certificate validation. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.Attention: This slows down performance
- See Also:
-
disableSslHostVerification
-
isDisableSslHostVerification
public boolean isDisableSslHostVerification()Disables SSL host verification. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.If you use the Java 11 of the Matomo Java Tracker, this setting is ignored. Instead, you have to set the system property
jdk.internal.httpclient.disableHostnameVerification
as described in the Module java.net.http.- See Also:
-
disableSslCertValidation
-
getThreadPoolSize
public int getThreadPoolSize()The thread pool size for the async sender. Defaults to 2.Attention: If you use this library in a web application, make sure that this thread pool does not exceed the thread pool of the web application. Otherwise, you might run into problems.
-
equals
-
hashCode
public int hashCode() -
toString
-